ffmpeg avformat_open_input always returns "Protocol not found" rv=(-1330794744)

ffmpeg, visual-c++, visual-studio-2010, windows

Solution

I was having the same problem. The correct initialization is

av_register_all();

Problem

Trying to get ffmpeg working in Visual Studio 2010. So far all ffmpeg headers and libs are loaded, no error or warning occurs. ``` 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)); } ``` The problem is, avformat_open_input always returning -1330794744 (errbuf="Protocol not found"). Tried x86 & x64 headers and libs on 32bit XP and 64bit W7. Whatever I put for "myfile.ext" (tried "file1.avi", "file=c:\file1.avi", "http://www.someweb.com/file1.avi", and even empty char* "") response is always "Protocol not found". Any ideas?

Original source