FFMPEG API:如何使用av_open_input_file连接到RTSP流? [英] FFMPEG API: How to connect to RTSP stream using av_open_input_file?

查看:831
本文介绍了FFMPEG API:如何使用av_open_input_file连接到RTSP流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



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);



它总是返回'找不到文件'。相同的网址,虽然,我可以看到,说,VLC播放器。我的代码有问题吗?



我正在使用FFMPEG 0.6,我应该使用最新的吗?

解决方案

原来我在构建FFMPEG时没有启用网络支持。



以下选项适用于我:



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


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?

解决方案

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

这篇关于FFMPEG API:如何使用av_open_input_file连接到RTSP流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆