尝试让 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/