[MPlayer-dev-eng] [PATCH] bframes, dwStart: individual patches

Corey Hickey bugfood-ml at fatooh.org
Fri Feb 17 22:37:34 CET 2006


Oded Shimon wrote:
>>+    muxer->audio_delay_fix -= sh_video->stream_delay;

...

>>+    muxer->audio_delay_fix += sh_audio->stream_delay;
> 
> Could you explain this?... Why do you add and then remove the stream delay?

Do you mean the two lines I've left quoted above? The first is for
video, where a positive stream_delay gets translated into negative audio
delay, and the second is for audio.

If audio_delay_fix is negative when muxer_avi writes the header, it ends
up being a positive video dwStart. Otherwise, it ends up being an audio
dwStart.

> BTW, it is interesting that taking an AVI file with a dwstart and 
> transcoding it with mencoder to some other format would basically make you 
> loose the delay. Personally I would've made the avi dwstart go into the 
> mencoder -delay, but mencoder -delay is too far from perfect for that I 
> guess...

Yes... I think that, ideally, a remuxing program should use dwStarts to
offset the PTS of all frames in that stream. I'm not entirely sure about
that, though, and investigating how to make it work with mencoder's
other muxers is one of my longer-term goals.

Nevertheless, I think working losslessly for AVI-->AVI remuxing is the
correct first step, and -delay will make mencoder duplicate frames
and/or cut off the first part of a stream.

-Corey




More information about the MPlayer-dev-eng mailing list