Tao.FFMPeg: 0 streams in AVFormatContext
Hi,
I'm trying to decode a video file using Tao.FFMpeg, but am hitting what seems to be a very basic problem.
This is my code:
int ret;
IntPtr pFormatContext;
ret = FFmpeg.av_open_input_file(out pFormatContext, path, IntPtr.Zero, 0, IntPtr.Zero);
if (ret < 0)
throw new Exception("couldn't open input file");
ret = FFmpeg.av_find_stream_info(pFormatContext);
if (ret < 0)
throw new Exception("couldnt find stream informaion");
formatContext = (FFmpeg.AVFormatContext)Marshal.PtrToStructure(pFormatContext, typeof(FFmpeg.AVFormatContext));
if (formatContext.nb_streams == 0)
throw new Exception("No streams found!");
The problem is that formatContext.nb_streams is always 0!
I've tested it on various files, video and audio, but it's always the same.
I'm using my own windows build of ffmpeg. This problem goes away when I use the default ffmpeg dlls in win32deps, but I need it to work with my own build.
Any help is appreciated.
Thanks,
klk

I am having this problem
I am having this problem aswell. Could anyone please help answer this thread? You know what they say about asking questions; "Speak up, because someone who is shy may be having the same question!" I ... Am that shy guy.
There is no spoon.
I ended up solving this
I ended up solving this problem, it's because the struct definitions in the C# files of Tao.FFMpeg are out of date compared to the latest version of FFMpeg.
After I changed the AVFormatContext struct definition in AVFormat.cs to reflect the current FFMpeg struct, it worked.