1. Hikvision and Dahua surveillance cameras and hard disk video recorders are connected to the GB28181 platform configuration
1. Hikvision device access configuration
Log in to the NVR management system through the web, enter the network, advanced configuration interface, and fill in the GB28181 related parameters.
Just fill in the corresponding items according to the configuration information just obtained. The encoding ID of the video channel below can remain unchanged (the hard disk video recorder needs to be entered). Note that the enable above must be checked, and then click Save.
2. Hikvision hard disk video recorder NVR access configuration
Log in to the NVR management system through the web, enter the network, advanced configuration interface, and fill in the GB28181 related parameters.
The hard disk recorder access and camera access configuration interfaces are almost the same, the difference is the configuration of video channel encoding. The video channel encoding ID of the hard disk video recorder is initially empty. It must be set to the correct encoding, otherwise the GB28181 platform cannot obtain the channel information. The specification of the video channel coding ID must comply with the national standard requirements. It must be a 20-digit number. Multiple channel numbers should not be repeated.
3. Dahua device access configuration
Log in to the NVR management system through the web, enter the network settings, platform access interface, and fill in the GB28181 related parameters.
2. Add a custom protocol to the NVR and add rtsp stream.
Take Hikvision NVR as an example.
1. NVR adds custom protocol
In the Hikvision NVR web background, select "Configuration"-->"System"-->"Channel Management"-->"Customized Protocol", as shown in the following figure:
1.1) First add the main stream. Use the main stream when NVR records, as shown in the figure below:
1.2) Then add a sub-stream. If a sub-stream is configured, it is recommended to use the sub-stream during preview, which can save decoding resources, as shown in the figure below: The
resource path can be seen in the background of the encoder (Output Settings --> playback address)
2. Add channel to NVR
In the Hikvision NVR web background, select "Configuration"-->"System"-->"Channel Management"-->"Add", as shown in the figure below:
Note: For the protocol type, select the "custom protocol" set above. After the addition is completed, there will be one more channel in the channel management, as shown in the figure below:
3. RTSP streaming and publishing.
1. rstp server side
rstp server side, using ZLMediaKit
2. rtsp push streaming
ffmpeg -stream_loop -1 -re -i "c:\input.mp4" -c:v libx264 -g 50 -f rtsp rtsp://admin:[email protected]:554/stream
-stream_loop: This option specifies the number of times to loop the input video. To loop the video infinitely, use -1 loop count. If you want to loop the video a specific number of times (for example, three times), use 3.
3. Test whether rtsp plays successfully
ffplay rtsp://admin:[email protected]:554/stream