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).

Embed Hikvision IP camera to web page

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:// – get the mainstream of the 1st channel

rtsp:// – get the sub stream of the 1st channel


RTSP with Authentication

rtsp://<username>:<password>@<IP address of device>:<RTSP port>/Streaming/channels/<channel

number><stream number>


rtsp://Hikvision:guest@ – get the main stream of the 17th channel

(1st IP camera on the Hybrid Demo)


rtsp://Hikvision:guest@ – 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.

Using the first format, you will be asked to login and verify your credentials before being allowed to view the stream.
Using the second format, you will automatically login when requesting the stream

<id> refers to the channel number and stream type of the camera. For example, an <id> of 101 refers to channel #1 (first digit, 1xx) using the main stream (second and third digits, x01).

Typically, you'll use a program such as VLC Media Player to decode the RTSP stream

Trade accounts available
Tel: 01234 816238