VIDEOCAMERA LIVE

Dahua and IMOU: RTSP URL and website streaming

Dahua cameras, NVRs and XVRs share one RTSP format, and many IMOU models use it too. Here is the exact URL, the menu paths, the user setup and the settings that keep video stable in a browser.

The RTSP URL format

A Dahua URL has two parameters: channel — the channel number (always 1 on a camera) — and subtype — the stream: 0 main, 1 sub. The same format works on IP cameras, NVRs and XVRs.

rtsp://user:password@203.0.113.10:554/cam/realmonitor?channel=1&subtype=0   # main stream
rtsp://user:password@203.0.113.10:554/cam/realmonitor?channel=1&subtype=1   # sub stream
What you needPath
Camera, main stream/cam/realmonitor?channel=1&subtype=0
Camera, sub stream/cam/realmonitor?channel=1&subtype=1
Recorder channel 5, main/cam/realmonitor?channel=5&subtype=0
Recorder channel 5, sub/cam/realmonitor?channel=5&subtype=1

RTSP port and access

RTSP is on by default on Dahua. In the classic web interface the port is under Setup → Network → Port, field RTSP Port (554). The newer interface has the same page under Settings → Network → Port. Changing the port reboots the camera.

Forward only the RTSP port on the router — see port forwarding. Do not expose the web ports (80, 443) or Dahua's TCP port (37777) to the internet.

A view-only user

  1. Setup → System → Account (newer interface: System → Account), tab User → Add.
  2. Choose the group user (not admin) and keep only the Live permission (on a recorder, only for the channels you need).
  3. Set a strong password. Use this user in our form, not admin.

Encoder settings for the web

Classic interface: Setup → Camera → Video → Video; in the newer one this page sits under Camera (often called Encode). Do Main Stream first, then Sub Stream.

SettingRecommended
Smart CodecOff (switch this off first — it locks other fields)
Encode ModeH.264 (Main) or H.264B (Baseline); not H.264H or H.265
Resolution1280×720 (720P) or 1920×1080 (1080P)
Frame Rate (FPS)15–25
Bit Rate TypeCBR
Bit Rate1024–2048 Kb/S for 720p, 2048–4096 Kb/S for 1080p
I Frame IntervalFPS × 1–2 (25–50 at 25 FPS)

If the main stream needs to stay H.265 for recording, set the sub stream to H.264 720p and use subtype=1 in the form. More in camera settings.

Common pitfalls

  • Smart Codec. It saves recording space but sends I-frames rarely and swings the bitrate. In a browser that means slow start-up and grey or smeared frames. Turn it off for streaming.
  • H.265. We detect H.265 cameras and convert to H.264 while someone watches, but H.264 is still the reliable choice. See H.265 in the browser.
  • H.264H (High Profile) and stuttering. If H.264 video jerks in the browser, switch to H.264 or H.264B. If that doesn't fix it, call us.
  • Account lock-out. After several wrong passwords Dahua locks the account for a while. If the test reports an auth error, check the details before retrying.
  • Special characters in the password. In a hand-built URL, @ or # breaks everything. In our form the password has its own field and the server encodes it correctly.
  • P2P and DMSS. Dahua's cloud connection does not provide RTSP. You need a public IP and a forwarded RTSP port.

IMOU cameras

IMOU is Dahua's consumer brand. Many IMOU models serve RTSP in the Dahua format: username admin, password — the device's Safety Code from the sticker (or the password you set later), path /cam/realmonitor?channel=1&subtype=0, and subtype=1 for the sub stream. Not every model or firmware supports RTSP: if the test says unreachable with correct details, the model may simply not serve it. The IMOU cloud does not work with us — the camera needs a local IP and a forwarded port.

Adding the camera to VIDEOCAMERA LIVE

  1. Create an account or log in and click Add camera.
  2. Fill in a name, an optional location, RTSP host, port, username, password and the path /cam/realmonitor?channel=1&subtype=0. Sub stream: subtype=1.
  3. Click Test connection: our server connects to the camera itself and reports success, auth error, unreachable, wrong path, unsupported codec or timeout.
  4. Once it succeeds, activate the camera and copy the embed code — see embedding a camera on a website.
What is the Dahua RTSP URL?

rtsp://user:password@IP:554/cam/realmonitor?channel=1&subtype=0 for the main stream, subtype=1 for the sub stream. On a recorder, channel is the channel number.

What is the IMOU password?

By default the Safety Code on the device sticker, with username admin. If you changed the password in the app, use that.

Will an analog camera on a Dahua XVR work?

Yes. An XVR serves analog channels over RTSP in the same channel/subtype format. See NVR and DVR.

Why does the test say wrong path?

Usually the channel is wrong (on a recorder) or the path doesn't start with /. Check the path character by character, including the question mark and &.

Put your camera on your website today

Sign up, add an RTSP link and get the embed code. Questions? Call us — our engineers answer.