2013-02-16 294 views
6

嘗試讓ffmpeg在Visual Studio 2010中工作。到目前爲止,所有ffmpeg頭文件和庫文件都已加載,不會發生錯誤或警告。ffmpeg avformat_open_input總是返回「未找到協議」rv =( - 1330794744)

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 *「」)響應始終爲「未找到協議」。有任何想法嗎?

回答

7

我遇到了同樣的問題。正確的初始化是

av_register_all(); 
+2

嗨,我想做一個示例鉻插件,使用ffmpeg。我有同樣的問題,我叫av_register_all(),但沒有希望。 – 2016-03-22 13:08:52

+0

@GeorgeVarghese我也遇到過同樣的情況。你解決了嗎? – 2017-11-08 16:58:50