Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG API: How to connect to RTSP stream using av_open_input_file?

I'm trying to connect to some RTSP stream using av_open_input_file() like this:

AVFormatContext* ic; avcodec_register_all(); av_register_all(); av_open_input_file(&ic, "rtsp://login:[email protected]/videoinput_1/mjpeg/media.stm", NULL, 4096, NULL);

It always returns 'file not found'. The same url, though, I can see in, say, VLC player. Do I do something wrong in my code?

I'm using FFMPEG 0.6, shall I use the latest instead?

like image 720
Alexander Kulyakhtin Avatar asked Oct 26 '11 18:10

Alexander Kulyakhtin


1 Answers

Turned out I did not enable network support when building FFMPEG.

The following options worked for me:

--enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264

like image 129
Alexander Kulyakhtin Avatar answered Sep 19 '22 05:09

Alexander Kulyakhtin