ffmpeg avformat_open_input始终返回"未找到协议"rv =( - 1330794744)

bzi*_*vic 8 windows ffmpeg visual-studio-2010 visual-c++

试图让ffmpeg在Visual Studio 2010中工作.到目前为止,所有ffmpeg头文件和库都被加载,不会出现错误或警告.

avcodec_register_all();
AVFormatContext *pFormatCtx = NULL;
char errbuf[256];
pFormatCtx = avformat_alloc_context();
int rv = avformat_open_input(&pFormatCtx, "myfile.ext", NULL, NULL);
if (rv!=0){                              
    av_strerror(rv, errbuf, sizeof(errbuf));
}
Run Code Online (Sandbox Code Playgroud)

问题是,avformat_open_input总是返回-1330794744(errbuf ="未找到协议").在32位XP和64位W7上尝试了x86和x64标头和库.无论我为"myfile.ext"做什么(试过"file1.avi","file = c:\ file1.avi"," http://www.someweb.com/file1.avi ",甚至是空的char*" ")响应始终是"未找到协议".有任何想法吗?

dis*_*ray 8

我遇到了同样的问题.正确的初始化是

av_register_all();
Run Code Online (Sandbox Code Playgroud)

  • 嗨,我正在尝试使用ffmpeg做一个示例chrome插件.我有同样的问题,我打电话给av_register_all(),但没有希望. (2认同)