What is the Dahua RTSP URL format?
Dahua's Network Video Server user's manual (version 1.1.1, on dahuasecurity.com since 2018) gives the format as rtsp://username:password@ip:port/cam/realmonitor?channel=1&subtype=0. The manual explains each part: the channel number starts with 1, subtype 0 is the main stream and subtype 1 the sub stream, and the default RTSP port is 554.
Unlike Hikvision's single number, Dahua splits the camera and the stream into two named settings after the question mark. That makes the address easy to read: channel=5&subtype=1 is camera 5's lighter stream, with nothing to decode.
The manual's own worked example is the sub stream of channel 2. With placeholders in place of its sample login and address, that is rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=2&subtype=1.
What are the Dahua RTSP addresses for each channel?
On an NVR or XVR, all cameras share the recorder's address and login, and only the channel value changes. Here are the two streams for the channels installers most often need:
- Channel 1 sub stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=1&subtype=1; main stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=1&subtype=0
- Channel 2 sub stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=2&subtype=1; main stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=2&subtype=0
- Channel 4 sub stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=4&subtype=1; main stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=4&subtype=0
- Channel 8 sub stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=8&subtype=1; main stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=8&subtype=0
- Channel 16 sub stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=16&subtype=1; main stream rtsp://USER:PASSWORD@HOST:554/cam/realmonitor?channel=16&subtype=0
Should you call the Dahua recorder or the camera itself?
Call the recorder in most cases. An XVR with analogue cameras has no other way in, because the cameras have no network address of their own: the third camera's main stream on an XVR at 192.168.1.108 is rtsp://admin:PASSWORD@192.168.1.108:554/cam/realmonitor?channel=3&subtype=0. An NVR with PoE ports often keeps its cameras on a private internal network as well.
A Dahua IP camera plugged into the main network can be called directly. It answers on its own address with channel=1: rtsp://viewer:PASSWORD@192.168.1.120:554/cam/realmonitor?channel=1&subtype=1. Its login may differ from the recorder's, so try the camera's own user if the recorder's is refused.
Where do you set the RTSP port on a Dahua device?
In the network connection settings. In the same manual, the path is Setup, Network, Connection, which lists the RTSP port with 554 as default, beside the HTTP port (80 by default) and Dahua's own TCP port (37777 by default). The manual adds that the port can be left out of the address when it is the default.
Only the RTSP port carries the stream a media player or monitoring service reads. Forwarding 37777 on a router, as some installers do for Dahua's own apps, does nothing for an RTSP address. Menus vary between models and firmware versions, so check the manual for your exact device if the screen doesn't match.
Why is my Dahua RTSP URL not working?
Match what you see to the likely cause:
- Connection refused or timed out. The RTSP port was changed, isn't forwarded, or is blocked. Read the port in Setup, Network, Connection and put that number after the colon.
- Login asked again, or 401 Unauthorized. The username or password is wrong, or it's the DMSS app login rather than the device's own.
- The address stops at the password. A password containing / or : (or @ and #) breaks the address until each is percent-encoded. A password like Back/Door:7 must be written rtsp://admin:Back%2FDoor%3A7@HOST:554/cam/realmonitor?channel=1&subtype=1. The RTSP URL generator encodes it for you.
- Connected but no picture, or a different camera. The channel value is wrong. Dahua counts from 1, so there is no channel=0, and the order matches the recorder's own channel list.
- Main stream plays, sub stream doesn't. The extra stream is turned off for that channel. The manual's encode page has a Video enable box for it, on by default.
- RTSP is off. Some firmware lets you disable RTSP; if no port answers even on the local network, look for an RTSP or streaming switch in the network settings.
How do you check a Dahua address in VLC?
Dahua's manual names VLC as a player that takes this address. In VLC, open Media, then Open Network Stream, paste the address with the & left as it is, and press Play. Do it on a computer at the site first; a picture there proves the address, the port and the login together.
Then check the stream. Tools, then Media Information, shows the codec and the picture size: the main stream shows the camera's full resolution, the sub stream a much smaller one. If you see the wrong camera, change channel=, not subtype.
What decides the quality of each Dahua stream?
The channel's encode settings, not the address. The address only chooses which of the two streams you receive; what each stream carries is set per channel on the encode page. Dahua's manual lists compression, resolution, frame rate and bit rate there, separately for the main and the extra stream, and notes that its Smart Codec option, which lowers the bit rate on parts of the scene that matter less, applies to the main stream only.
So when a sub stream looks too soft for the job, raise its resolution or bit rate on the recorder rather than switching the address to subtype=0. The sub stream then stays light enough for remote viewing while showing enough to recognise what moved.
How does GoKavach use the Dahua RTSP URL?
Pick Dahua or CP Plus in GoKavach, enter the recorder's address, port, login and channel, and it builds the sub stream address, subtype=1, which keeps upload low. Live view can switch to the main stream for detail. If the Dahua format gets no picture, the Hikvision one is tried with the same login.
The Dahua camera page covers what works beyond alerts, such as the camera's own siren and the recorder's disk alerts. The CP Plus RTSP URL guide covers the same format on CP Plus recorders, and the Hikvision RTSP URL guide the other common format.