Find your camera's RTSP link
An RTSP link tells StreamLink where the video is and how to log in. It usually looks like this:
rtsp://USERNAME:PASSWORD@ADDRESS:554/PATH
- USERNAME / PASSWORD: the camera's login. Create a separate user that can only view video if your camera supports it.
- ADDRESS: the camera's address. For pull mode, use the public IP or DDNS name (e.g.
myshop.ddns.net). For push mode and VLC tests on site, use its local IP (e.g.192.168.1.64). - 554 is the usual RTSP port. Use another port if you changed it or forwarded a different one.
- PATH depends on the brand; see the table.
| Brand | Main stream (best quality) | Sub-stream (lighter) |
|---|---|---|
| Hikvision cameras and NVRs | /Streaming/Channels/101 | /Streaming/Channels/102 |
| Dahua, CP Plus, Amcrest most models | /cam/realmonitor?channel=1&subtype=0 | /cam/realmonitor?channel=1&subtype=1 |
| Uniview (UNV) | /unicast/c1/s0/live | /unicast/c1/s1/live |
| Reolink | /h264Preview_01_main | /h264Preview_01_sub |
| TP-Link Tapo | /stream1 | /stream2 |
| Axis | /axis-media/media.amp | /axis-media/media.amp?resolution=640x360 |
Brand notes
- NVRs and DVRs carry several cameras. On Hikvision, camera 2 is
/Streaming/Channels/201, camera 3 is301, and so on. On Dahua and CP Plus, changechannel=1to the camera's number. - TP-Link Tapo doesn't use your TP-Link account password. In the Tapo app open the camera → Settings → Advanced Settings → Camera Account, create a username and password, and use those.
- Reolink: on newer firmware, first turn on RTSP under Settings → Network → Advanced → Port Settings. Cameras set to H.265 use
h265Preview_01_main. - Other brands: look for "RTSP" in the camera's manual, or use the free ONVIF Device Manager on a PC in the same network. It shows the stream link for each camera it finds.
Special characters in the password? Characters like @ : / # ? confuse the link. Replace them: @ → %40, : → %3A, / → %2F, # → %23, ? → %3F. Or use a password with only letters and numbers.
Example for a Hikvision camera at the public address 203.0.113.10:
rtsp://viewer:Str0ngPass@203.0.113.10:554/Streaming/Channels/101
Test the link with VLC
Before adding a camera, check that the link plays. In the free VLC media player:
- Open Media → Open Network Stream (on Mac: File → Open Network).
- Paste the RTSP link and press Play.
- If you see video, the link is right. Testing from home (outside the camera's network) also proves port forwarding works.
In StreamLink, the Test button next to the link does the same from our server. It shows the video and audio formats or explains what went wrong.
Pull mode and port forwarding
In pull mode, StreamLink connects to your camera when someone starts watching. Our server must be able to reach the camera, so you need either:
- a public IP from your internet provider (fixed is best; otherwise use DDNS, which most routers and NVRs support), and
- a port forward on your router: forward TCP port
554(or any free external port) to the camera's or NVR's local IP and RTSP port.
Tips:
- Give the camera a fixed local IP (a DHCP reservation in the router), so the forward keeps working after a restart.
- Forward only the RTSP port, never the camera's web page (80/443) or the NVR's management port.
- Use a separate camera user that can only view video, with a strong password.
- Mobile (4G/5G) connections and many fibre plans use CGNAT, where port forwarding can't work. Use push mode there.
Push mode: no port forwarding
In push mode, a computer on the camera's network sends the stream to StreamLink. Nothing is opened on your router, so it works behind 4G routers, CGNAT and strict office networks.
- In StreamLink, add a camera and choose Push. Its Share tab shows the push URL and a ready-made command.
- On a PC, mini PC or Raspberry Pi on the camera's network, install FFmpeg (on a Raspberry Pi:
sudo apt install ffmpeg). - Run the command with your camera's local RTSP link. It looks like this:
ffmpeg -rtsp_transport tcp -i "rtsp://USER:PASS@192.168.1.64:554/Streaming/Channels/101" -c copy -f rtsp -rtsp_transport tcp "PUSH-URL-FROM-THE-SHARE-TAB"
-c copy forwards the video without re-encoding, so even a Raspberry Pi handles several cameras.
Keep it running
Linux / Raspberry Pi: save as /etc/systemd/system/streamlink-gate.service, then run sudo systemctl enable --now streamlink-gate.
[Unit]
Description=StreamLink push: gate camera
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/ffmpeg -nostdin -loglevel warning -rtsp_transport tcp -i "rtsp://USER:PASS@192.168.1.64:554/Streaming/Channels/101" -c copy -f rtsp -rtsp_transport tcp "PUSH-URL"
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
In systemd files, write any % in the links as %%.
Windows: save as streamlink-gate.bat and add it to Task Scheduler to run "At startup":
:loop
ffmpeg -nostdin -loglevel warning -rtsp_transport tcp -i "rtsp://USER:PASS@192.168.1.64:554/Streaming/Channels/101" -c copy -f rtsp -rtsp_transport tcp "PUSH-URL"
timeout /t 5
goto loop
Keep the push URL private: it contains the camera's publish key. If it leaks, press New push key on the Share tab and update the command.
Embed the player on your website
Open the camera's Share tab and copy the embed code. Then:
- WordPress: add a Custom HTML block and paste the code.
- Wix: Add → Embed Code → Embed HTML, paste the code, and resize the box to 16:9.
- Google Sites: Insert → Embed → Embed code.
- Shopify, Squarespace, Webflow, Blogger: use their "Custom code" or "HTML" block.
- Your own HTML: paste it where the video should appear. It scales to the page width.
To share without a website, send the link by WhatsApp, email or QR code. It opens a full-screen player.
Copy protection (allowed sites)
Under Access → Copy protection, list the domains that may show the player, e.g. yourcompany.com and *.yourcompany.com. Every other site then gets a blank frame, while the direct link keeps working. On Wix, the code runs inside a Wix frame: if the player stays blank, also add *.filesusr.com.
Troubleshooting
"Test" says the login failed
Check the username and password, and encode special characters (see above). Some cameras lock a user after several wrong attempts. Wait a few minutes or restart the camera.
"Test" times out
Our server can't reach the camera. Check the public IP or DDNS name, the port forward, and that your provider doesn't use CGNAT. Testing in VLC from another network shows the same. If it can't be fixed, use push mode.
The player stays black
Most browsers can't play H.265 (HEVC) live. In the camera's video settings, set the stream to H.264, or use the sub-stream, which is often H.264 already.
No sound
First check that Sound is on for this camera (Main tab). For sound in the low-delay player, set the camera's audio codec to G.711 (also called PCMU / PCMA / G711u). AAC audio only plays when the player is using HLS.
Video stutters or freezes
Use the sub-stream or lower the camera's bitrate (1–2 Mbit/s is plenty for a website), and use a constant frame rate. In pull mode, the camera's upload speed must cover one stream. In push mode, the on-site upload must too.
It plays on my site but not on another
That's copy protection working: the other site isn't in the camera's Copy protection list.
Still stuck? Contact us with your camera's brand and model and we'll help.