[MPlayer-dev-eng] enhancement for yuv4mpeg output driver

Trent Piepho xyzzy at speakeasy.org
Wed Jan 19 22:31:26 CET 2005


On Wed, 19 Jan 2005, Steven M. Schultz wrote:
> On Tue, 18 Jan 2005, Trent Piepho wrote:
> > floating point value (right?).  The yuv4mpeg driver turns this into x/1000000,
> > e.g. 23.98 fps becomes 23975999/1000000
> 
> 	That's been a PITA for eons - getting F29969999:1000000 instead of
> 	30000/1001.

I'm glad I'm not the only one it's been annoying.

> > mplayer has the wrong idea of the pixel aspect isself, for example, a 720x480
> > 4:3 NTSC DVD should be scaled to 720x528, not 720x540.  So I added an 'aspect'
> 
> 	The scaled size isn't placed in the yuv4mpeg2 header so I think that's
> 	a different issue (when playing the movie on the computer for example)
> 	but you're right, the wrong thing is being done.
> 
> 	The SAR (sample aspect ratio) placed in the yuv4mpeg2 header 
> 	should be 10:11 for "NTSC", and 59:54 for "PAL" (or 40:33 and 118:81
> 	for 16:9 movies in the two video systems).  Hmmm, but when you're
> 	decoding a SVCD the SAR is 15:11 and 59:36 respectively).  Does the
> 	yuv4mpeg module have sufficient knowledge to emit the correct 'A'
> 	tag?  If not then "0:0" is appropriate.

I use mplayer's idea of the correct scaled size of the video to guess the
sample aspect ratio.  In some cases this works, a 704x480 4:3 DVD will have
a SAR of 10:11, a HDTV capture will have a SAR of 1:1, etc.  In some cases
it is sligtly off, due to pixel rounding.  In others it is off by a bit more,
because mplayer has the wrong idea of the SAR itself.

> 	720/540 is a 4/3 display image using square pixels (which is what
> 	computer displays use) so that's correct.  Not sure how 528 was
> 	derived - how did you come up with 720x528 being a 4/3 display aspect?

Try it with mjpegtools, and it will be obvious.  The sample aspect ratio of a
720x480 DVD is 10:11, yes?  So make yourself a 720x480 A10:11 y4m file with
mplayer and my patch or y4mcolorbars or something.  Now scale it with
yuvscaler -O SIZE_720x540, then again with yuvscaler -O SIZE_720x528.  Which
one gives an output sample aspect ratio of 1:1?




More information about the MPlayer-dev-eng mailing list