windows - ffmpeg avformat_open_input 总是返回 "Protocol not found"rv=(-1330794744)

标签 windows visual-studio-2010 visual-c++ ffmpeg

尝试让 ffmpeg 在 Visual Studio 2010 中工作。到目前为止,所有 ffmpeg header 和库都已加载,没有错误或警告发生。

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

问题是,avformat_open_input 总是返回 -1330794744(errbuf="找不到协议(protocol)")。在 32 位 XP 和 64 位 W7 上尝试过 x86 和 x64 header 和库。无论我为“myfile.ext”输入什么(尝试过“file1.avi”、“file=c:\file1.avi”、“http://www.someweb.com/file1.avi”,甚至是空 char*“”),响应总是“找不到协议(protocol)” .有什么想法吗?

最佳答案

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

av_register_all();

关于windows - ffmpeg avformat_open_input 总是返回 "Protocol not found"rv=(-1330794744),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14914634/

相关文章:

c++ - 更改已编译/压缩 EXE 的标题

windows - OpenSSL 和读取 openssl.conf 文件时出错

c++ - 如何修复 stb_image 库的 alpha

VS2012中的C++自定义内存分配链接错误

c++ - 了解 Visual C++ 控制台项目中的 _tmain

windows - 为什么 OSX 在 amd64 间接跳转时出现总线错误?

windows - 在 Windows 下使用 GIT with/SSH key 文件的问题

c++ - Visual Studio 2012 : Compiler setup (possible to use Compiler from SDK eg. VC++2008-编译器 VC++2010-编译器)

visual-studio-2010 - 如何在方法 block 内折叠注释 block 的代码?

c++ - 如何在 visual studio 2010 express 中将 cpp 编译为 dll