For the past few weeks I\'ve been struggling with the ffmpeg API since I can not find a clear documentation and I also find it hard to search as all the solutions I find onl
Your problem seems to be somewhat specific to DirectShow. Unfortunately I don't have access to a system with DirectShow, but from the symptom it looks like the capture is not your problem. What is wrong is the muxing part. May be the format of the video packets is not directly supported in AVI, or may be the timestamps on the packets are broken.
I will recommend a few things that you should try, one at a time:
av_write_frame
instead of av_interleaved_write_frame
.grabFrames
take the raw video packets and dump them into a file. That should give you a file that is playable by ffplay. (You will probably have to specify resolution, pixel format and format in your ffplay command.)demuxing_decoding.c
and decoding_encoding.c
. That should give you a proper video file. (Playable in most players.)I don't know anything about DirectShow, and I don't know your use case. So my recommendations focus on FFmpeg API. Some of it may be overkill / may not do what you want.