[MPlayer-dev-eng] mencoder frame duplication bug

Jan Kritzner kritzner at i4.informatik.rwth-aachen.de
Tue Dec 17 18:11:50 CET 2002


Hello,

I've used mencoder to transcode videos with variable frame-rates to avi-Files 
with a fixed frame-rate.
The input file was a video with a frame rate of 10fps and presentation 
timestamps in the file. Assume that frames 10-19 have been lost.

MPlayer does the right thing, presents frame 9 for 1.1 seconds, and continues 
with frame 20.

MEncoder calculates the right "frame_time", but duplicates the frame following 
the gap, i.e. frame 20 is presented for 1.1 seconds.

FIX:

Update
"v_timer_corr-=frame_time-(float)mux_v->h.dwScale/mux_v->h.dwRate;"
before the number of skips is calculated.

Should be a trivial fix, but I haven't looked at side-effects.
Jan 


Diff against CVS 20021217:

--- mencoder.c  2002-12-16 02:49:38.000000000 +0100
+++ mencoder.c 2002-12-17 18:01:58.000000000 +0100
@@ -991,6 +991,8 @@
     if(in_size<0){ at_eof=1; break; }
     sh_video->timer+=frame_time; ++decoded_frameno;

+v_timer_corr-=frame_time-(float)mux_v->h.dwScale/mux_v->h.dwRate;
+
 if(demuxer2){  // 3-pass encoding, read control file (frameno.avi)
     // find our frame:
        while(next_frameno<decoded_frameno){
@@ -1044,8 +1046,6 @@

 } // demuxer2

-v_timer_corr-=frame_time-(float)mux_v->h.dwScale/mux_v->h.dwRate;
-
 ptimer_start = GetTimerMS();

 switch(mux_v->codec){




More information about the MPlayer-dev-eng mailing list