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

戏子无情 提交于 2019-12-09 06:32:08

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/7906944/ffmpeg-api-how-to-connect-to-rtsp-stream-using-av-open-input-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!