[MPlayer-dev-eng] Need help with A/V sync in new video filter

Rich Felker dalias at aerifal.cx
Sun Apr 16 01:26:48 CEST 2006


On Sat, Apr 15, 2006 at 03:58:18PM -0700, Walter Belhaven wrote:
> > I may be mistaken but I'm pretty sure softpulldown allows any
> > sequence as long as the sequence is valid.
> 
> When this check fails:
> 
>   if ((state == 0 && !(flags & MP_IMGFIELD_TOP_FIRST)) ||
>       (state == 1 &&   flags & MP_IMGFIELD_TOP_FIRST))
> 
> as it does with this messed up 1080i source, softpulldown produces the
> the "wrong" output -- it ends up discarding perfectly valid fields
> that it stored previously.

It's impossible for frame N to have TFF set unless frame N-1 ended on
the bottom field (i.e. also had TFF=1, RFF=0 or TFF=0, RFF=1). This is
not an arbitrary restriction, it's simply a fact of interlaced video.

> > What you're trying to do does not look valid. Why are you trying to
> > add/remove fields? The repetition pattern in the original stream
> > should just be used as-is.
> 
> I'm just trying to expand fields/frames exactly as the flags suggest.

This is what softpulldown is supposed to do. If it doesn't do it
correctly you may want to fix it rather than writing a new filter.

> The reason I'm going through all of this is that I cannot find a
> reliable way of transcoding 1080i "video" (not film!!) to (interlaced)
> NSTC DVD.  One of two things happens:
> 
> 1. Something tries to inverse telecine or deinterlace.
> 2. I get seemingly random field reversals.
> 
> Both of these look horrific, as you can imagine, in the final DVD.

Yes. The core issue is that mencoder does not do what you want. You
need a program (maybe ffmpeg?) that will respect and preserve the
original TFF/RFF sequence in the output.

> > Yes, it will mess it up. I'm still completely confused about why you
> > want to do this.. Just pass the original TFF/RFF flags to the
> > encoder!
> 
> Because certain filters such as 'scale' eat the TFF/RFF flags, so the
> encoder will never see them.  I put a hack in to dump the flags
> before/after 'scale' (-vf scale=720:480:1), and regardless of the
> input flags, 0x0 comes out every time.

Yes, mencoder really is not made for the stuff you want to do. :(

Rich




More information about the MPlayer-dev-eng mailing list