How to Connect and Test Hikvision IP Camera RTSP Streams
Step-by-step guide to constructing Hikvision RTSP URLs, authenticating ports, and testing live video feeds in OpenCV or VLC.
Need to construct an authenticated RTSP URL for this camera brand?
#1Hikvision RTSP URL Syntax & Parameters
Hikvision IP cameras, PTZ domes, and NVRs transmit H.264 and H.265 video streams over RTSP on port 554 by default. You can construct the URL manually or use our interactive IP Camera RTSP URL Builder to assemble credentials and port values automatically.
The standard URL structure authenticates via basic or digest credentials and accesses channel endpoints:
rtsp://admin:password123@192.168.1.64:554/Streaming/Channels/101#2Understanding Channel Numbering (Main vs Sub Stream)
Hikvision uses a standard 3-digit channel scheme: - Channel 101: Camera 1 Main Stream (Full 4K/1080p resolution) - Channel 102: Camera 1 Sub Stream (Standard definition for mobile & AI) - Channel 103: Camera 1 Third Stream (MJPEG or low-bandwidth preview) - Channel 201: NVR Camera 2 Main Stream - Channel 801: NVR Camera 8 Main Stream
#3Testing Hikvision Stream in Python OpenCV
Capture and process Hikvision RTSP frames with low-latency TCP transport in Python. For a comprehensive walkthrough on frame buffering and lag prevention, see our guide on Reading RTSP Streams in Python with OpenCV:
import os
import cv2
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;tcp"
rtsp_url = "rtsp://admin:password123@192.168.1.64:554/Streaming/Channels/101"
cap = cv2.VideoCapture(rtsp_url, cv2.CAP_FFMPEG)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow("Hikvision Feed", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()#4Common Hikvision Troubleshooting
If you receive a 401 Unauthorized error: 1. Verify digest authentication is enabled in Camera Configuration > System > Security > Authentication. 2. Ensure the "admin" user has the "Remote Live View" permission enabled in User Management. 3. Make sure the RTSP port 554 is not blocked by local firewalls.
For a complete deep-dive into authentication handshakes, read our guide on Resolving RTSP 401 Unauthorized Errors.
Frequently Asked Questions
What is the default port for Hikvision RTSP streams?
The default port is TCP/UDP 554. You can change this in the camera web GUI under Configuration > Network > Basic Settings > Port.
How do I access sub-stream on Hikvision NVR camera 4?
Use channel code 402: rtsp://admin:pass@NVR_IP:554/Streaming/Channels/402.
Ready to test your live RTSP video stream?
Generate free authenticated RTSP links with unlimited bandwidth and inspect frame timestamps in seconds.
Related Tutorials & Setup Guides
View all 100+ guidesVivotek IP Camera RTSP Stream Setup & SDP Endpoints
Complete guide to Vivotek RTSP SDP endpoints, codec selection, and VLC network stream testing.
hardwareAmcrest 4K ProHD & NVR RTSP Stream Reference Guide
Quick reference manual for Amcrest 4K ProHD and NVR RTSP media URLs, sub-streams, and VLC media player testing.
hardwareUniview (UNV) IP Camera & NVR RTSP Setup Guide
Learn the exact RTSP parameters, authentication options, and channel settings for Uniview and UNV security cameras.