5

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?

1 Answer 1

8

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

Sign up to request clarification or add additional context in comments.

5 Comments

I didn't find --enable-protocol=rtsp. How did you fix that?
I used --enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264 in the configure file, that did let me enable rtsp
-enable-demuxer=rtsp solved my problem as well. I didn't need h264 as my app works only with audio streaming.
@AlexanderKulyakhtin parameters are exactly what I did need to have RTSP streaming work. I know thanks comments need to be avoided, but this answer can be really useful to other users too, so be reassured this is the real deal!
Nowadays adding --enable-demuxer=rtsp already adds the necessary protocols (rtp udp http tcp). I believe --enable-network doesn't exist anymore...?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.