[MPlayer-dev-eng] [PATCH] Fix yuv4mpeg output, remove spurious first frame.

D Richard Felker III dalias at aerifal.cx
Sat Jun 21 00:21:02 CEST 2003


On Fri, Jun 20, 2003 at 07:47:32PM +0200, Linards Ticmanis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Glen Nakamura wrote:
> 
> >>"-vo yuv4mpeg" currently outputs a spurious all-zero (i.e. fully
> >>saturated green - *ugly*) first frame. This patch gets rid of this. Now
> >>"-ss <some time> -frames 13" for example will give you exactly 13 frames
> >>in the stream.yuv file.
> >
> >
> > the blank frames have helped me with a/v sync in the past.  e.g. i
> wouldn't
> > have to specify an offset when multiplexing the a/v streams.
> > but, i didn't like them being green so i use the following patch
> > to make them black...
> 
> I don't use mplayer for the sound normally if I have a Dolby Digital
> source... I use Azid since there I know the Dolby Surround compatible
> downmix will really work. I found that the blank frame actually seems to
> destroy a/v sync in that case, and this is the reason I wrote this
> kludge in the first place. Or am I wrong? A desync of 1 frame is not
> easy for me to notice with 100% accuracy.
> 
> But, the blank frames are not good when you join more than one source
> together... of course I wrote a little C thingy to throw out the
> additional yuv4mpeg headers, I guess I could modify it to also throw out
> 1 frame after each header, but...
> 
> I believe mplayer shouldn't output anything that's not there in the
> source. Am I right with this general principle?

Yes, but I don't think you quite understand it right. The first blank
frame mplayer gives you is not there in the source; it's caused by the
way B frame decoding works. BUT (!!!) the later blank frames ARE
actually there in the source. AVI and probably several other formats
allow insertion of "blank" (0-byte-long) frames to indicate that the
previous one should be repeated. If you just go removing these, A/V
sync could break all over the place!!

BTW, what do you mean by "I don't use mplayer for the sound"?? I'm not
really familiar with this stuff and don't know what "Azid" is, but for
DTS you should be piping it through mplayer with "hwac3" (which also
does DTS passthru now, iirc) so that MPlayer knows about and can
maintain a/v sync. Otherwise your only hope is that both programs
start at the exact same time and neither ever gets stalled up -- quite
a miracle if this works...


Rich



More information about the MPlayer-dev-eng mailing list