0
我試過用ffmpeg lib從我的代碼打開文件。而avformat_open_input總是收到錯誤「沒有這樣的文件或目錄」。我嘗試了不同的文件和目錄,但結果是一樣的。ffmpeg lib函數avformat_open_input無法打開文件
我使用VS 2010的Win7和編譯的lib和dll從http://ffmpeg.zeranoe.com/builds/
的我的代碼位。
int decode_sound(const char * infile, const char * outfile)
{
AVFormatContext *pFormatCtx = 0;
if((err = avformat_open_input(&pFormatCtx, infile, NULL, 0)) != 0)
return 1;
}
int _tmain(int argc, _TCHAR* argv[])
{
avcodec_register_all();
cout << decode_sound("D:\\DELTA.MPG", "D:\\wav.wav") << endl;
char errbuf[128];
const char *errbuf_ptr = errbuf;
if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
strerror_s(errbuf, AVUNERROR(err));
cout << err << endl << errbuf_ptr << endl;
system("pause");
return 0;
}