Check for a video stream using ffmpeg command inside C program

There may come a situation in video streaming architectures, where we have process something, according to the condition whether a stream is present or not. This can be quite tricky if video publish stream(say RTMP stream) is up and down frequently.

You can achieve such a trick by using a code like below, and you have to just call checkForStream(your_stream_url). It returns non-zero if stream is currently up.

Leave a Reply