New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 728303 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

8K video + high device pixel ratio leads to distorted aspect ratio

Project Member Reported by strobe@chromium.org, May 31 2017

Issue description

Chrome Version: 58, 60 (seen for a loooong time tho)
OS: Win, Mac, Linux

- Start playing an 8K video (e.g. https://www.youtube.com/watch?v=1La4QzGeaaQ ), in 8K

- Fullscreen it

- Increase the device pixel ratio by zooming in (e.g. using Ctrl-+)

- Notice that the video aspect ratio becomes distorted

This is really obvious on an 8K display which will default out-of-the-box to zoom settings that trigger it, but I can easily reproduce it on a 4K display by zooming in past 2.5x.

I can reproduce this behavior by navigating directly to an 8K transcode outside of the YouTube player (internal only example: go/8k-video-for-crbug ), so it's not a YouTube or video sizing problem.
 
Cc: mlamouri@chromium.org
Hmm, +mlamouri. Does this happen with an 8k image as well? I can't think of anything specific to video which would affect this.

Comment 2 by strobe@google.com, May 31 2017

Nope, 8K images are apparently immune.
Cc: hubbe@chromium.org
Interesting, I'll try it out tomorrow when I'm back at my desk and see what I can find out. +hubbe since he has a 4K display as well.

Comment 4 by hubbe@chromium.org, May 31 2017

I can't seem to trigger this bug on chrome stable on Linux with a 4K display.


Comment 5 by strobe@google.com, May 31 2017

I just tried on a friend's machine and reproduced on a 1440p display; had to go up to 400% (or maybe 500%) zoom there before it reproduced.

Comment 6 by hubbe@chromium.org, May 31 2017

I forgot to lock the video resolution to 8K.
Once I did that it reproduces on all my screens...

For what I can tell, the <video> element aspect ratio stays the same (1.77) and it seems that Chrome adds letter boxing when hitting 500%. I can't tell if that's on the layout or compositing side.
Components: Blink>Compositing Blink>Layout
+some compositing and layout folks.
Components: -Blink>Compositing -Blink>Layout Internals>GPU>Video Blink>Media>Video
Labels: BugSource-Chromium PaintTeamTriaged-20170602
This would be a direct composited video, I think. Looping in those folks and Blink's video folks (that might be the same set of people already following).
Cc: schenney@chromium.org
schenney@ those folk are already on this bug :) As mounir notes in c#7 there seems to be some sort of letterbox being applied at high zoom levels.
I know pretty much nothing about how the video element is painted when it's directly composited. Is the issue the layer size that we're requesting of the GPU and/or the layout of the video tag?

Out of interest, what's the pixel width/height on a 8K display? Could we be trying to avoid short integer overflow of some kind at high zoom levels?
7680×4320 is the standard 8K resolution. The bug also reproduces on 1440p screens at higher zoom levels.

Comment 13 by enne@chromium.org, Jun 2 2017

Cc: enne@chromium.org
Status: Available (was: Untriaged)

Comment 14 by strobe@google.com, Aug 16 2017

Been a minute. It's still embarrassing to demo 8K on Chrome, and I'd like to get in a fix in Stable before CES next January where 8K will likely be ubiquitous. Is there anything I can do to help this?
Cc: liber...@chromium.org
+liberato since he's been interested in getting into the compositing side of things more.
there is a VideoLayer on my linux box, and it does show the problem.

the bounds of the VideoLayer change abruptly from a ratio of 1.77 to 2.43 at 500% zoom on my linux machine.  makes me think that it's on the blink side, since the bounds are set pretty much directly.

if nobody's picked this up by the beginning of next week, then i'll look further.
Owner: liber...@chromium.org
Status: Assigned (was: Available)
Frank, want to pick this up or delegate for this Q?
Cc: beccahughes@chromium.org
cc:beccahughes since I see her fixing zoom issues :)
i'll take another look.
Labels: -Pri-3 M-65 Pri-2
Frank, any updates here? Going to go ahead and tag this with a milestone and up the pri so it doesn't fall off our plate again.
no, i haven't gotten back to this yet.
seems to be bad math in LayoutUnit.

in a case with proper aspect ratio, LayoutSize::FitToAspectRatio computes the height as 1704*17280/30720 = 958.5 which is 1.77 aspect ratio (1704 / 958).

in a bad case, it computes the height as 1704*21600/38400 = 873, which is the wrong aspect ratio.  it's also just plain wrong.  bc tells me that it equals the same 958.5 .

probably could fix it with a call to ToFloat(), but i want to be sure that the overloaded ops aren't just broken.
Project Member

Comment 23 by bugdroid1@chromium.org, Nov 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53479ca91ac63d89a22c06db86a4292edcb2fa65

commit 53479ca91ac63d89a22c06db86a4292edcb2fa65
Author: liberato@chromium.org <liberato@chromium.org>
Date: Tue Nov 28 19:19:33 2017

Avoid saturation when computing LayoutSize aspect ratio.

8k video could cause LayoutUnit to saturate multiplication when
computing the correct aspect ratio.  This CL does the calculation in
floating point, instead.

Bug:  728303 
Test: LayoutSizeTest
Change-Id: I632777e2f140b8203577b3e5e0761f3e7f891aa2
Reviewed-on: https://chromium-review.googlesource.com/773108
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519784}
[modify] https://crrev.com/53479ca91ac63d89a22c06db86a4292edcb2fa65/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/53479ca91ac63d89a22c06db86a4292edcb2fa65/third_party/WebKit/Source/platform/geometry/LayoutSize.h
[add] https://crrev.com/53479ca91ac63d89a22c06db86a4292edcb2fa65/third_party/WebKit/Source/platform/geometry/LayoutSizeTest.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment