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:password@xxx.xxx.xxx.xxx/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?

Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158

1 Answers1

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

Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
  • I didn't find --enable-protocol=rtsp. How did you fix that? – Mike Bevz Nov 09 '11 at 08:40
  • 3
    I used --enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264 in the configure file, that did let me enable rtsp – Alexander Kulyakhtin Nov 10 '11 at 16:59
  • -enable-demuxer=rtsp solved my problem as well. I didn't need h264 as my app works only with audio streaming. – Mike Bevz Nov 10 '11 at 19:49
  • @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! – cdf1982 Sep 24 '19 at 04:51