How to capture a single image from a video stream without connecting a stream (bandwidth problem)

I'm not sure that this is possible, but how can I get one image from a video stream WITHOUT connecting the stream itself (rtsp) (I have a problem with bandwidth)?

(priority for python, but any code framework / language would be good).

This is an example SDP file for a stream:

v=0 o=Teleste 11501847 688 IN IP4 1.1.1.1 s=unnamed (mpeg4/tx-1) i=Teleste MP-X AUDIO/VIDEO Encoder c=IN IP4 221.1.1.1/64 t=0 0 m=video 4002 RTP/AVP 96 b=AS:6400 a=rtpmap:96 MP4V-ES/90000 a=fmtp:96 profile-level-id=1;config=000001B005000001B509000001000000012000C4F84048800F516843C1463F 

I have a solution to retrieve a single image after establishing a connection to a stream, but I am looking for a solution that does not require a full connection to the stream due to a bandwidth problem.

I am new to the world of streaming video and any idea or suggestion would be good.

thanks

0
video-streaming video video-capture sdp rtsp
source share
1 answer

If your server does not support some functions to ensure this, I do not think that you can get something from the stream without connecting to the stream.

You probably already have some kind of solution that will connect, get the frame, and then disconnect, I think. If you don’t know, you can also do this with ffmpeg using the following command, although I’m not sure if the overhead of the bandwidth or how it opens and closes the connection under the covers, you will need to experiment with it to see:

ffmpeg -y -i rtsp: // your_rtsp_strea -frames: v 1 output.jpg

It is worth noting that the codec used will affect the number of frames you need - simple codecs or codec profiles will encode each frame separately, but others will have reference frames, for example, the 10th frame and the intervals between frames will be encoded as a delta for the reference frames. Therefore, you need to actually get the previous, and sometimes the next reference frame in addition to the target frame, in order to actually extract the image.

If your stream is available in DASH or HLS, you also have the option of simply loading one segment - these protocols have already broken the video stream into several segments, usually somewhere between 2 and 10 seconds. However, you need to make sure that you are loading the segment from the required bit rate - these protocols will have several bit-bit streams to provide different permissions and network conditions.

0
source share

All Articles