我正在尝试在Visual Studio 2010中使用ffmpeg。目前已经加载了所有的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));
}
问题在于,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*“”),响应始终是“协议未找到”。有任何想法吗?