[mythtv-users] Nvidia 720x480 troubles

Shawn Asmussen asmussen at cox.net
Tue Aug 10 20:00:57 EDT 2004

> On Mon, Aug 09, 2004 at 09:47:40PM +0100, Ian Armstrong wrote:
>> On Monday 09 Aug 2004 17:44, Greg Estabrooks wrote:
>> > > >that 720x480 is the best resolution to capture at with the
>> Hauppauge
>> > > > card,
>> > >
>> > > You need to set your recording profiles to use an aspect ratio of
>> square.
>> > > You will also need to set any other program you use (xine, mplayer )
>> to
>> > > use square as well.
>> > > You really shouldn't need to do this but nvidia can't seem to ever
>> get
>> > > anything quite right.
>> >
>> >  The problem is that X's DisplayWidthMM and DisplayHeightMM
>> > (used in videoout_xv.cpp) are returning values that work out to be an
>> > aspect ratio of 1.5(4:3 with 720x480 is not) and videoutbase.cpp
>> doesn't
>> > take into account situations where the source image is identical to
>> the
>> > current display resolutions. As such it is forcing a resize of the
>> video
>> > down to be 640x480 displayed on a 720x480 screen.
>> Pixel resolution has nothing to do with the aspect ratio. In PAL,
>> 720x576
>> could be either 4:3 or 16:9. You can't work out the aspect ratio just by
>> looking at the number of pixels in either the width or the height. If
>> DisplaySize for X is set correctly, the image should be scaled to the
>> right
>> size regardless of the actual resolution used. Both Xine & Myth honor
>> DisplaySize, but MPlayer ignores it & needs a command line option to set
>> it.
> And, to expand one layer further: pixels need not be square.
> That's why the D-1 standard is 720x486, and yet is also 4:3.  It's also
> how consumer camcorders do pseudo-scope widescreen: they record the
> same number of effective pixels across, but they're *wider*.
> Cheers,
> -- jra
> --
> Jay R. Ashworth
> jra at baylink.com

Ok. So, since mythtv is using the values gotten from DisplayWidthMM and
DisplayHeightMM, I typed up this quick program to see what my Xserver was
returning for those values:

#include <stdio.h>
#include <X11/Xlib.h>

int screen;
Display *display;
display = XOpenDisplay((char *) NULL);
screen = DefaultScreen(display);

Sure enough, the values that I got were in about (But not quite exactly) a
3:2 ratio instead of a 4:3 ratio. However the values I got back were in no
way related to the actual physical dimensions of my display, so I have no
idea how they were generated. I found an option for XF86Config called
DisplaySize that lets you override the values for the size of the screen,
and I measured my TV and set the values to 660, and 495. I could have just
used any 4:3 numbers I suppose, but if I'm going to override, I figured
what the heck, I might as well use the real values. Acutally I rounded
ever so slightly to get the exact 4:3 ratio, but close enough. Now the
picture fills the whole screen. However, I am still not 100% sure that no
scaling is being done. I ran my test program again after making the
changes to the XF86Config, and the numbers I got back were 677 and 508
instead of 660 and 495. These numbers come close to being a 4:3 ratio, but
aren't exactly 4:3. Therefore, I don't know for sure if this means that
mythtv would do some sort of unneccessary scaling to try to make it truly
4:3. Does anybody know why the numbers I put into the XF86Config file got
slightly munged? I suppose I can experiment with values in the config file
and find a pair of values that has an end result of the DisplayWidthMM and
DisplayHeightMM functions returning values that match up at exactly 4:3,
but I would prefer to know why the values I am using are being modified.
Does anybody know why that is?

Shawn Asmussen

More information about the mythtv-users mailing list