How to stream a Dahua camera on a website

Typical RTSP URL, external access, and a ready rtsp.me player

Dahua is a major manufacturer of IP cameras and video surveillance systems. Most network cameras from the brand support RTSP and multiple streams, so they can be connected to rtsp.me and embedded on a website without running your own media server.

Validate RTSP URL

What to prepare

Create a dedicated account with minimum permissions and a strong unique password. Do not use the camera administrator and do not expose the full RTSP URL publicly.

Dahua RTSP URLs

Main stream of channel 1

rtsp://<login>:<password>@<ip>:<port>/cam/realmonitor?channel=1&subtype=0

Sub stream of channel 1

rtsp://<login>:<password>@<ip>:<port>/cam/realmonitor?channel=1&subtype=1

For channel 2, replace channel=1 with channel=2. On some models and firmware versions, the URI may differ, so use ONVIF to get the exact stream URL if needed.

Example URL

If external port 10554 is forwarded to camera port 554, the main stream URL looks like this:

rtsp://viewer:StrongPassword@203.0.113.10:10554/cam/realmonitor?channel=1&subtype=0

Replace the login, password, public IP, and port with your own values. The address 203.0.113.10 and password shown here are examples only.

Set up internet access

Reserve the camera's local IP and forward an external TCP port on the router to its RTSP port.

Public IP:10554 → router → 192.168.1.100:554

Step-by-step router examples: "How to configure port mapping".

Do not enable DMZ and do not expose the camera web interface. If your ISP uses CGNAT, use connection without a static IP.

Connection through software agent

If the site has no public IP address or opening an RTSP port on the router is not possible, install the rtsp.me software agent on a computer or mini PC in the same local network as the camera.

The agent receives the local Dahua RTSP stream and sends it to rtsp.me over an outbound connection. In this case, port mapping and an internet-exposed RTSP port are not required.

Dahua → local network → software agent → internet → rtsp.me

Windows, Linux, and ARM are supported. Setup steps are described in "IP camera streaming agent without static IP".

Add the camera on rtsp.me

  1. Build the RTSP URL with the public address and external port.
  2. Paste it on rtsp.me and click Test.
  3. After a successful check, add the camera.
  4. Get the player HTML code and embed it on your website.
Dahua → RTSP → rtsp.me → HTML5 player → website

Frequently asked questions

How do I choose the main stream?
Use subtype=0. For the sub stream, use subtype=1.
Why does the URL fail?
Check credentials, channel, subtype, RTSP port, port mapping, and whether a public IP is available.

Connect Dahua to rtsp.me

Validate your RTSP URL and get a ready website stream.

Validate RTSP URL