How to stream a Dahua camera on a website
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 URLWhat to prepare
- Local IPFor example, 192.168.1.100
- RTSP portUsually TCP 554
- User accountA separate view-only account
- Public addressRouter IP or DDNS hostname
Dahua RTSP URLs
Main stream of channel 1
Sub stream of channel 1
- channel=1First video channel
- subtype=0Main stream
- subtype=1Sub stream
- portRTSP port, usually 554
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:
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.
Step-by-step router examples: "How to configure port mapping".
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.
Windows, Linux, and ARM are supported. Setup steps are described in "IP camera streaming agent without static IP".
Add the camera on rtsp.me
- Build the RTSP URL with the public address and external port.
- Paste it on rtsp.me and click Test.
- After a successful check, add the camera.
- Get the player HTML code and embed it on your website.