[MEncoder-users] framerate control question

Trent Piepho xyzzy at speakeasy.org
Wed Nov 22 00:15:34 CET 2006


On Tue, 21 Nov 2006, rob pfile wrote:
> Trent Piepho wrote:
> > How are you removing 3 out of 5 frames?  Could it be some problem
> > where not
> > enough frames are getting dropped by whatever you are using to do
> > inverse
> > telecine?  Of if it's ending up short, maybe too many frames are
> > getting
> > dropped?
> >
>
> well, i took a look at how people were doing it in avisynth, and i
> put together something similar. first i hacked decimate to drop all
> of the odd frames, which emulates SelectEven(). then i hacked divtc
> pass 2 to look at the divtc pass1 logfile and drop the most similar
> frame out of each group of 5, emulating Decimate(5). so right now its
> a 3-pass solution but if i can get it working i was going to try to
> hack divtc pass 1 to do the SelectEven() and framediff all at once.

I gave up with divtc and just wrote my own (1-pass filter).  It seems to
work pretty much perfectly now.  I only get "Skipping frame!" messages
(because my filter did not drop enough frames) during black sequences, for
instance before commercials.  In this case it hardly matters which black
frame is dropped, since they are all the same.  There are only a couple of
mistake frames in an entire episode of Lost.  They are all in very low
motion scenes and even stepping frame by frame you can't tell something is
wrong.

> > > i'm wondering how in heck to get a nice smooth 24p version of a 60p
> > > ATSC transmission which doesnt require timestretching the audio.
> >
> > I wrote a filter that does the inverse telecine for progressive
> > content
> > (drops the duplicate frames) and encode with -ofps 24000/1001 -mc .
> > 042 and
> > it appears to work very well.  I'm using -oac copy to preserve the
> > original
> > AC3 audio.
>
> so it sounds like i'm reinventing your wheel. to be quite honest i
> dont yet understand exactly what -mc does. but of course 0.042 is
> roughly the display time of one 24000/1001 frame. i'll give it a try.

I'm not sure exactly that it does either.  I wonder if anyone really
understands how this part of mencoder works.

I'm pretty sure if you use -mc 0, mencoder won't attempt to add or delete
frames to compensate for A and V drift.  If you specify -ofps 24, and
supply more or less than 24 frames/sec (because you inv. telecine filter
is not perfect), then you will get audio de-sync.

When I first play an ATSC stream, the video is about one second ahead of
the audio.  If I use -mc .1, it takes longer for the audio to catch up to
the video than if I use -mc 1.  With -mc 1, the first couple frames are
clearly shown for a much longer time than with -mc .1.  I seems like the mc
value is the amount of extra time mplayer will show a frame for to slow
down the video.  I'm not really show how this translates into how mencoder
decides if it needs to add or drop a frame.



More information about the MEncoder-users mailing list