[MEncoder-users] regarding skipped/duplicate frames during framerate conversion

pfile at pacbell.net pfile at pacbell.net
Fri Dec 8 18:40:50 CET 2006


On Thu Dec 7 09:44:23 CET 2006, rob pfile wrote:

> > It seems like the problem is that mencoder doesn't cope with a
> > filter chain
> > that also adjusts v_timer_corr.  mencoder looks at v_timer_corr and
> > decides
> > it needs to make an adjustment (adding or skipping a frame) and
> > then calls
> > the decode/filter/encode layer to process the next input frame.
> > This also
> > adjusts v_timer_corr but mencoder didn't take that into account
> > when it
> > made its dup/skip decision.  You end up with a double adjustment
> > that moves
> > v_timer_corr too far.
> >
>
> is that really true though? if it decided to skip a frame, it
> increments skip_count and adjusts v_timer_corr. then it calls
> decode_video() and if that returns 0 (dropped frame), then it adjusts
> v_timer_corr again, but only if skip_count is <= 0. so it seems like
> you dont actually get a double correction to v_timer_corr, but you do
> get a skipped frame next time. so maybe the right thing to do is to
> decrement skip_count if it is > 0 in the case that decode_video()
> returned 0.
>

i made this hack, and it seems to have improved things a great deal.  
there are no more skipped frames, and no repeated pattern of skips/ 
dups. however, on a typical 1 hour show there seem to be about 700  
duplicated frames, again due to the v_timer_corr code. i still have  
to chase that down.

> > By making mencoder wait for v_timer_corr to be off by 1.5 frames I
> > was able
> > to stop the dup/skip cycle.  It gives the inverse telecine filter
> > another
> > frame to bring thigns back into sync before causes a skip/dup.
> >
>
> i made a similar hack, and this seemed to work okay. however,
> probably due to the pts hack described below, at edit points i was
> getting a whole burst of pts duplicate frames. in the end i've
> resorted to encoding the audio without the video and using -noskip,
> and then merging the audio back in to avoid all this nonsense. but

i figured out what was going on here... -mc 0.042 is causing the  
strange behavior at edit points. not sure why.

so anyway, i'm running with the skip_count decrement hack, the  
v_timer_corr code using < and > rather than <= and >=, and with the  
v_pts_corr code trying to keep the pts within 1.2* of the frametime,  
and its working reasonably well modulo the dups.

rob




More information about the MEncoder-users mailing list