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

Walter Belhaven wbelhaven at yahoo.com
Thu Apr 20 07:53:30 CEST 2006


--- Rich Felker <dalias at aerifal.cx> wrote:

> 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.

Agreed.  What I failed to realize is that, in addition to the above,
softpulldown enforces Top Field First, which makes its state machine
vastly simpler than if it didn't.  Turns out that TFF is *exactly*
what I want (I'm transcoding for NTSC interlaced DVD, after all), and
so, you're correct that softpulldown will work in my application.

HOWEVER ... I still have a couple of comments and concerns.

First, I have to completely disable mencoder's A/V sync algorithm in
order to prevent the audio and video from diverging massively.  (I
used "-noskip -mc 0" for that.)  Luckily, my source was well behaved
enough that this didn't cause any harm.  Sure wish there was a way to
"undo" the calculation that *R*FF normally does in the timing code, so
that I don't have to disable A/V sync entirely.  Perhaps this is what
you meant by "The core issue is that mencoder does not do what you
want." :)

Second, there are a couple of things about the implementation of
softpulldown which seem odd.  First is the "Thou Shalt not pass mpi
as-is" rule which it (sometimes) violates.  But also, when you ask
vf_get_image() for an image of type MP_IMGTYPE_STATIC, are you
*guaranteed* that it will pass you the same chunk of memory each time?
I ask because softpulldown copies the "Repeated" field into dmpi (an
automatic variable!) without ever saving it to somewhere more
persistant, apparently relying on each call to vf_get_image() to
return the same exact set of image-data pointers each time.  Am I
reading this correctly?  And if so, shouldn't this be fixed?

Thanks much for your help and for convincing me I didn't need a new
filter! 

WB


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the MPlayer-dev-eng mailing list