[MPlayer-dev-eng] MPlayer MPEG4 Seeking Bug (and patch)

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Mar 29 21:24:28 CEST 2011


On Mon, Mar 28, 2011 at 06:59:52PM -0700, Andyz Smith wrote:
> I use mencoder to capture video from the TV card and encode it to MPEG4.
> 
> I open the resulting file with GMplayer, while it's still growing to achieve a DVR like effect.
> 
> I noticed that the seek behaviour with MPEG4 was quite poor.  Major distortion of the image was present for several seconds after seeking forward 10 seconds or selecting a random position with the slider.
> 
> Encode to MPEG2 worked much better.  
> MPEG4 with a keyint of 10 also made large improvements. 
> 
> Neither of those is really a solution.  
> 
> Upon review of the mplayer source code I believe the following is a rather large bug in the MPlayer MPEG4 decoder/demuxer seeking.  My suggested patch and comments (AJS) follow.

I don't want to discourage anyone (since what I am going to say next probably
won't be done that soon), but there is a better/more thorough solution:
Patch the FFmpeg decoder to indicate various errors, in particular
the "missing reference frame".
Use that flag to discard all continuous frames that have this flag set
after seeking/at start of decoding (preferably should be optional).
An performance improvement of that would be to set a flag that tells
FFmpeg to not even try error concealment in such a case and just not
return a frame in that case. Has a higher risk of A-V sync issues though.
As a short-term solution, using -demuxer lavf should work, too.


More information about the MPlayer-dev-eng mailing list