[FFmpeg-user] RTSP input source

Andriy Gelman andriy.gelman at gmail.com
Thu Dec 17 17:34:37 EET 2020


On Thu, 17. Dec 15:08, Sandeshwar Sharma wrote:
> Hi All,
> I'm creating an output video file continuously from an input RTSP source
> (cctv camera).
> But when the camera is disconnected (for any reason) from the network,
> ffmpeg takes a while (more than 1 minute) to throw an error.
> I would like to know which ffmpeg args needs to be passed to change this
> behaviour and detect the camera's disconnection as early as possible.
> Command I'm using:
> ffmpeg -stimeout 5000000 -i rtsp:// -s 320x200 -f
> mpegts -codec:v mpeg1video -stats: -r: 30 -an output.mp4

If you apply these 4 patches to master:

Then stimeout option will also apply while you are streaming.


you can quickly apply the patches with the following command:
$ curl https://patchwork.ffmpeg.org/series/2759/mbox/ | git am

More information about the ffmpeg-user mailing list