W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2008

[whatwg] video tag: pixel aspect ratio

From: Sander van Zoest <sander@vanzoest.com>
Date: Mon, 17 Nov 2008 22:28:33 -0800
Message-ID: <98c2a8300811172228x7bcf858cv561b5c57d2169429@mail.gmail.com>
On Mon, Nov 17, 2008 at 2:32 PM, Philip J?genstedt <philipj at opera.com>wrote:

> I should point out that the pixelratio attribute isn't only for authors,
> it's also useful when the media framework used doesn't recognize the
> (pixel) aspect ratio even when it's correctly set. From reading the
> mplayer man page I see that AVI files can have aspect ratio set in the
> OpenDML vprp header, but I doubt e.g. DirectShow supports this (I could
> be wrong though).


It does. You need to install a DS filter that supports the OpenDML based AVI
2.0.
But, we should probably focus on Media Foundation Transforms instead.

I don't feel very strongly about the attribute either way, but given
> that video is scaled to fit inside its element box with aspect preserved
> and not simply stretched then an incorrectly parsed/guessed aspect ratio
> would make a big difference.


Depending on how you want to accomplish you can do that with an enum
that defines how to handle the case:

1) do nothing.
2) disproportionately adjust
3) stretch follow by letter-,pillar-,windowbox appropriately.
4) complete fill the screen and ignore overscan (ala pan & scan or zoom)*

*

> This seems very similar to the width/height
> attributes of an image and that usually isn't considered an ugly hack.
> If the pixelratio attribute is removed then I would suggest also
> removing the involvement of aspect ratio over the size of the element.


on digital images, all you need is width/height. things like dot pitch, PPI
and
DPI only play a roll when you are scanning/capture (analog to digital) or
dealing with displays (digital to analog).

It is just that in video, to save bandwidth and avoid interference, they
came out
with cool tricks such as interlacing, non-square pixels and odd frequencies.
Because of that, we are in this weird situation. I mean 59.94Hz is a perfect

example of that.

Scaling and stretching and adjusting the aspect ratio are as much part of
video
as they are part of images, it is just that you also need to worry how it
aligns with
other sources, such as CC, Line 21 and audio. Just as the aspect ratio is a
concern
for images, it is a concern here.

By the way, the "pixel-aspect-ratio" on video caps in the GStreamer
> framework has precisely the same meaning as this attribute, overriding
> it on a video sink also has an effect similar to what is suggested in
> the HTML5 spec. In other words, it's not so outlanding from a media
> framework's point of view.


In the capture world it makes a lot of sense. You are converting analog
content
into digital. It is my understanding that HTML5 is presentation technology,
not
a video capture, transcoding or editing framework.

Also, note that in GStreamer it is expressed as a ratio, not a float
("1/1").

Oh, and if the video also needs cropping to get the correct aperture,
> couldn't this be done with CSS perhaps?


Wow. How would you know how much to crop for each video clip? Wouldn't
specifying the enum above do the trick?

-- 
Sander van Zoest
sander at vanzoest.com
San Diego, CA, USA
http://Sander.vanZoest.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081117/bb64b3f0/attachment.htm>
Received on Monday, 17 November 2008 22:28:33 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:07 UTC