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

[whatwg] video tag: pixel aspect ratio

From: Philip Jägenstedt <philipj@opera.com>
Date: Mon, 01 Dec 2008 17:04:35 +0100
Message-ID: <1228147475.11030.53.camel@localhost>
On Mon, 2008-12-01 at 12:39 +0000, Ian Hickson wrote:
> On Mon, 1 Dec 2008, Philip Jgenstedt wrote:
> >
> > Now that the pixelratio override is gone, shouldn't the influence of 
> > pixel aspect ratio on the layout be removed also?
> 
> It is, isn't it? What did I leave in?

"Video content should be rendered inside the element's playback area
such that the video content is shown centered in the playback area at
the largest possible size that fits completely within it, with the video
content's aspect ratio being preserved. Thus, if the aspect ratio of the
playback area does not match the aspect ratio of the video, the video
will be shown letterboxed or pillarboxed. Areas of the element's
playback area that do not contain the video represent nothing."

> > I would prefer if the default were to stretch to fit if both 
> > width/height are given, just like for img. Letterboxing/pillarboxing 
> > should be the special case, is the idea that we should have the 
> > equivalent of SVG:s preserveAspectRatio either via CSS or HTML?
> 
> We definitely don't want to stretch the video. One of the important use 
> cases if having a video playback area and then playing videos with 
> different aspect ratios in that playback area. It should all just work.

I'm having a hard time seeing how this is a use case for video and not
for img. If one wants the intrinsic width/height to be used, then simply
don't set width/height. Otherwise, just setting just one of width/height
or using CSS max-width/max-height should do the trick.

This is strange:

<video src="circle.mpg" width="400" height="400"> <!-- circle -->
<video src="circle.mpg" width="400" height="300"> <!-- pillarbox -->

<img src="circle.jpg" width="400" height="400"> <!-- circle -->
<img src="circle.jpg" width="400" height="300"> <!-- oval -->

I think it would be much more consistent if these elements behaved in
the same way. As it stands, after the pixelratio was removed, there is
no way to display a circle as an oval or vice versa, which means it is
both impossible to fix an incorrect aspect ratio or to stretch the video
for some other purpose.

So, what is the difference between images and moving images?

-- 
Philip J?genstedt
Opera Software
Received on Monday, 1 December 2008 08:04:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC