Hikvision RTSP How to embed IP camera on web page
Wednesday, 7 August 2019 | Admin
If you wish to embed a Hikvision IP camera into your web page or YouTube then you will need to know the RTSP URLs for Hikvision IP cameras.Many VMS programs require you manually add the RTSP stream from the camera, in which case you'll need to know Hikvision's RTSP format.
Below are the RTSP URLs for viewing live stream as of the time of posting (Hikvision have changed format couple of times in the past).
This is the format to follow for all Hikvision IP products
RTSP without Authentication (NVR/DVR/IPC/Encoder)
rtsp://<IP address of device>:<RTSP port>/Streaming/channels/<channel number><stream number>
NOTE: <stream number> represents main stream (01), or the sub stream (02)
rtsp://192.168.1.168:10554/Streaming/channels/101 – get the mainstream of the 1st channel
rtsp://192.168.1.168:10554/Streaming/channels/102 – get the sub stream of the 1st channel
RTSP with Authentication
rtsp://<username>:<password>@<IP address of device>:<RTSP port>/Streaming/channels/<channel
rtsp://Hikvision:email@example.com:10554/Streaming/channels/1701 – get the main stream of the 17th channel
(1st IP camera on the Hybrid Demo)
rtsp://Hikvision:firstname.lastname@example.org:10554/Streaming/channels/1902 – get the sub stream of the 19th channel
(3rd IP camera on the Hybrid Demo)
HTTP commands to get IPC MJPEG stream
1. Camera firmware need to be v4.1 or higher
2. Can only stream the Sub stream via HTTP
3. Need to change the Sub stream video encoding to MJPEG
4. Resolution can be changed via web interface
NOTE: If the HTTP port of the device is still 80 (default), then “:<HTTP port>” is not required.
HTTP without Authentication
http://<IP address of IPC>:<HTTP port>/Streaming/channels/102/httpPreview
HTTP with Authentication
http://<username>:<password>@<IP address of IPC>:<HTTP port>/Streaming/channels/102/httpPreview
Snapshot using HTTP URL
http://<IP address of IPC>:<HTTP port>/Streaming/channels/1/picture
Where <IP> is the IP address of your camera, <port> is the RTSP port of the camera ( 554 is default) and <username> and <password> refer to the login credentials of your camera.