Reputation: 11
I'm using ffmpeg to demuxer, for some video like the windows's sample Wildlife.wmv, the av_read_frame is always returning packet.stream_index=0. This leads the video queue very big and memory overflow. I get 15 frames of video, but only 1 frame of audio. Is there some options to control the av_read_frame, so I can read frames like: video-audio-video-audio, in this way it's easy to sync AV and keep queue balance.
Thanks in advance.
Upvotes: 1
Views: 2057
Reputation: 629
av_read_frame just returns whatever is stored in the file in the order it finds it without any validation.
So the answeris no, there is no FFmpeg option for this, but you can try to control this yourself after getting each packet.
In the past we developed a media player and for problems like this we read audio & video in different threads and then synched presentation ourselves.
Upvotes: 1