[MPlayer-users] A-V-sync in mencoder

D Richard Felker III dalias at aerifal.cx
Mon Mar 22 05:41:34 CET 2004


On Mon, Mar 22, 2004 at 12:41:26AM +0200, Ville Saari wrote:
> On Sun, Mar 21, 2004 at 11:48:12AM -0500, D Richard Felker III wrote:
> 
> > > How come? If the input is constant framerate, the inverse telecine filter
> > > uses constant input-output-ratio and the output is constant framerate, then
> > > the only source of unpredictability is the phase of the telecine pattern,
> > > which can cause a difference of one frame at most.
> > 
> > ROTFL! The phase is not set once, but hundreds or thousands of times
> > during the movie.
> 
> That's the magnitude of the number of frames in the movie. If the telecine

A movie typically has around 150000-200000 frames. So hundreds would
be once every few hundred frames. I have content where the phase
changes about that often. OK, thousands was an exaggeration. :)

> pattern were to reset that many times, then we wouldnt have any pattern at
> all. In my experience it only happens between a few and a few dozen times
> during a movie (of course it shouldn't happen at all if the DVD was authored
> right, but such disks seem to be extremely rare).

No, you misunderstand the process. Sometimes you have a full 24fps
film, and you telecine it for DVD all at once. If this is the case,
you should be using soft-telecine anyway, and if not, the DVD is
mismastered.

But on the other hand, you can have content that was originally
produced at film-framerate in separate clips, then edited as
made-for-tv content. This could be a tv program produced partially on
film, or taking clips from film, or (much more commonly) animation.

> But the amount of discontinuities in the telecine pattern should not matter.
> The filter should still output frames at a constant rate. If we are creating
> a 23.976 fps avi from an NTSC DVD, then the filter should output exactly
> 4 frames for each ten fields read from the DVD (counting the repeated fields
> too) no matter what happens with the telecine pattern.

No, the only way to do this is to artificially duplicate frames. And
this is dumb. In the general case, inverse-telecined material cannot
be made to fit fixed-24-fps. You need a 1/120 sec base clock with most
frames having 5-tick duration, but some varying at splice points.

> If it doesn't do that,
> then it distorts the time axis and introduces a need to do something to keep
> the audio sync.

Only if you want fixed-fps output, which is a bad goal unless you're
tagetting antiquated file formats like avi.

> If the filter does have constant input-output-ratio, then we can predict
> perfectly reliably the mapping between source fields and ripped frames
> in those positions where the ratio gives integral results. Between those
> positions there's unpredictability of plus or minus one frame at most.
> 
> > > And if the inverse telecine filter doesn't use strictly constant
> > > input-output-ratio, then it is plain wrong unless the video pipeline
> > 
> > No, your assumptions about how telecine is done are plain wrong.
> 
> My assumption is based on two facts:
> 
> 1. NTSC signal has constant field rate.
> 2. Contents of an NTSC DVD are intended to produce that signal.

These facts are totally irrelevant. What's relevant is the input
frames _before_ pulldown is applied, and in fact these may have
duration of 1 field, 2 fields, 3 fields, or actually _any_ number of
fields for animation. Thus there is no predictable correspondence
between input "frames" (field-pairs) and output frames when you do the
inverse telecine.

> If you are not going to argue with those, then it should be quite difficult
> to disprove that encoding an NTSC DVD to a constant frame rate avi would
> require a constant input-output-ratio in the filter chain.

Actually quite easy. If you're going to make naive claims about
telecine, try making an inverse-telecine filter that actually works
based on those claims. You'll find it doesn't work at all...

Rich




More information about the MPlayer-users mailing list