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.
Mick
source share