[pvrusb2] Aspect ratio trouble
Mike Isely
isely at isely.net
Mon Aug 31 15:57:13 CDT 2009
On Mon, 31 Aug 2009, Bernhard Geier wrote:
> I have a pvrusb2 and I'm using the in-kernel module from 2.6.30.5.
>
> As most tv stations broadcast in 16:9 I've set pvrusb2's
> ctl_video_aspect to 16:9.
> Now recordings do have a 16:9 aspect ratio, but are in fact 4:3
> recordings stretched to 16:9 - they still have those black bars on top
> and bottom, and circles look like eggs.
When you tell the driver to change the video aspect, what you are doing
is changing a piece of data in the stream that states what the aspect
ratio of the image is intended to be, regardless of the actual
horizontal / vertical resolution which actually doesn't change. (This
is a good thing.) This is why you can, for example, capture either in
720x480 or 640x480 resolution and still have the image display as 4:3 -
the playback application is using that embedded aspect ratio information
and stretching / compressing the actual frame appropriately so that is
displays correctly.
This only works if the playback application however pays attention to
that embedded aspect ratio information. It is conceivable that an
application may disregard this and instead simply assume that all pixels
are square. For a 640x480 capture with square pixels you'll actually
get a 4:3 image, but that won't be the case for 720x480, just to cite
one example.
>
> I tried to play a little with ctl_crop_XXX and ctl_cropcap_bounds_XXX
> without knowing what their good for...no use at all, couldn't change the
> values there.
Don't bother with those; they have to do with cropping of the image and
that will only work if the underlying digitizer's driver (e.g. cx25840)
supports it, which none do at the moment :-(
>
> Recording resolution is 720x576 if that matters. So: What can I do to
> get real 16:9 recordings, without black bars and deformation?
Try some experiments with mplayer first. I know this is not what you
want, but it will help to see what's happening to the stream. Do a
720x576 capture into a file with the video_aspect set to 4:3. Now do
another capture into another file with the video aspect set to 16:9.
Play back each with mplayer. You should see mplayer sizing the frame
correctly for the aspect ratio in each case. I know this works - I've
done it (actually I've even done this mid-stream and mplayer still gets
it right). But if it isn't working for you here with mplayer then we
need to investigate a problem with the driver or how you're using it.
If it *does* work, then we know that you're getting a properly formatted
stream. So next I'd look at your playback app. If the app isn't paying
attention to the embedded aspect ratio info, then let's hope there's a
way to manually set that within the app - perhaps there's another way to
tell the app that your pixels aren't actually square. What app is this?
If you can't find a way to set the desired aspect ratio from within the
app, then the only option I think you have left is to try changing the
capture resolution so that the pixels are in fact square again.
(Actually if the app really is assuming square pixels, then 720x576
already isn't 4:3 - it's 5:4.)
-Mike
--
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
More information about the pvrusb2
mailing list