V
V
Vladosio2021-04-16 17:19:47
CCTV
Vladosio, 2021-04-16 17:19:47

What is the best internet protocol to use to record video from an IP camera? How to remove the delay when recording video?

1. Which protocol (http or rtsp) is better to use to capture video from an IP camera with recording and saving? I tried to use it separately, it turned out that http works with slight interruptions and delay (1-2 seconds) and frame loss (small parts) on the video, and rtsp works smoothly, but a very large delay (it happens differently, 20, 30 or more seconds), but the video output is good without frame loss.
2. How to remove the delay and what does it depend on or how to reduce it to a minimum on rtsp/http? Of course, I would like the picture to be smooth, both when watching a video and during recording.
3. Because of what there can be such a big delay in rtsp? Maybe use a different codec? Only I tried different ones (x264, XVID, DIVX, avc1, etc. probably), but nothing changed.
4. Will the ending in rtsp (as I have h264_pcm.sdp) work on other cameras or can each camera have a different ending? I want to leave it in the code, and not enter it manually.

cam = cv2.VideoCapture('http://' + a1 + '/video')
сam = cv2.VideoCapture('rtsp://' + a1 + '/h264_pcm.sdp')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Armenian Radio, 2021-04-16
@gbg

The interval between key frames is responsible for the stream playback delay - the smaller it is, the lower the delay and the higher the bitrate. Video can only start playing from a keyframe. That is, it is a codec parameter, not a stream.

S
Sergey Litovko, 2021-04-22
@litovko

The delay in playback and recording depends on the processing of the rtsp stream. I managed to get it down to 0.1-0.2ms at 1080p. The ffmpeg libraries were used.
I would not count on the endings in the url of the streams. The manufacturer is free to determine it. Write down the url at least in the ini file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question