[Libav-user] avformat_open_input: adding a timeout
grewa008 at d.umn.edu
Sat Jul 26 00:09:56 CEST 2014
I'm currently writing a video streaming app that uses the ffmpeg libraries.
I'm dealing with a situation where I'm preparing an instance of
AVFormatContext by calling avformat_open_input. I'm using this over a
network under RTSP and I need to handle cases where a connection cannot be
established. I figured the best way to go about this is to add a connection
timeout of around 5-10 seconds, but I just can't seem to figure out how to
get this idea to work. Any help is greatly appreciated.
if(avformat_open_input(&formatCtx, "rtsp://192.168.0.100/1", NULL,
LOGI(".100 not working... trying .101");
formatCtx = NULL;
if(avformat_open_input(&formatCtx, "rtsp://192.168.0.101/1", NULL,
return -1; // Couldn't open file
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user