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

Issue 153094 link

Starred by 10 users

Issue metadata

Status: Fixed
Last visit > 30 days ago
Closed: Oct 2012
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression

Sign in to add a comment

HW video decode breaks h.264 <video> frame grabbing for 2d canvas and WebGL

Reported by, Sep 28 2012

Issue description

OS Version: Windows 7, 64 bit
Exact GPU vendor/model: Nvidia Quadro 2000M
URLs (if applicable):
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Firefox 15.0.1: OK

What steps will reproduce the problem?
1. Go to or

What is the expected result?
There should be scenes with video textures shown, looking like this:

What happens instead?
Black screen in WebGL example, black rectangle which was supposed to be textured with video in canvas example.

Please provide any additional information. Attach a screenshot if possible.

This problem holds both for ANGLE and OpenGL renderers. 

With OpenGL bug behavior is slightly different: in canvas example rectangle is transparent instead of black, in WebGL example there is "CONTEXT_LOST_WEBGL" exception shown in console.

Both canvas and WebGL examples work ok in Chrome 21.0.1180.89

The problem persist also in  Chrome Canary 24.0.1280.0

The same issue happens also on a different computer, Windows 7, ATI Radeon 3650M.

Also got confirmations from other people on Twitter that video textures stopped working for them with update to Chrome 22, some of which used other code than three.js

Please copy the contents of about:gpu (chrome://gpu/) below. On Linux, please also paste the content from about:sandbox.

Graphics Feature Status
Canvas: Hardware accelerated
Compositing: Hardware accelerated
3D CSS: Hardware accelerated
CSS Animation: Accelerated
WebGL: Hardware accelerated
WebGL multisampling: Hardware accelerated
Flash 3D: Hardware accelerated
Flash Stage3D: Hardware accelerated
Texture Sharing: Hardware accelerated
undefined: Hardware accelerated
Version Information
Data exported	Sat Sep 29 2012 01:17:51 GMT+0200 (Central Europe Daylight Time)
Chrome version	22.0.1229.79 (Official Build 158531)
Operating system	Windows NT 6.1 SP1
Software rendering list version	2.8
ANGLE revision	1245
2D graphics backend	Skia
Performance Information
Graphics	6.9
Gaming	6.9
Overall	5.9
Driver Information
Initialization time	404
GPU0	VENDOR = 0x10de, DEVICE= 0x0dda
Optimus	false
AMD switchable	false
Driver vendor	NVIDIA
Driver version
Driver date	8-18-2012
Pixel shader version	3.0
Vertex shader version	3.0
GL version	
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	11
dwHeight	1080
dwRefreshRate	60
dwWHQLLevel	0
dwWidth	1920
iAdapter	0
lDriverSize	18250088
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	Quadro 2000M
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Integrated RAMDAC
szDDIVersionEnglish	11
szDDIVersionLocalized	11
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Supported
szDXVAModes	ModeMPEG2_A ModeMPEG2_C ModeVC1_C ModeWMV9_C
szDescription	NVIDIA Quadro 2000M
szDeviceId	0x0DDA
szDeviceIdentifier	{D7B71E3E-4E9A-11CF-4B76-C2011CC2C435}
szDeviceName	\\.\DISPLAY1
szDisplayMemoryEnglish	1720 MB
szDisplayMemoryLocalized	1720 MB
szDisplayModeEnglish	1920 x 1080 (32 bit) (60Hz)
szDisplayModeLocalized	1920 x 1080 (32 bit) (60Hz)
szDriverAttributes	Final Retail
szDriverDateEnglish	8/18/2012 19:43:00
szDriverDateLocalized	8/18/2012 19:43:00
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 1.1
szDriverModelLocalized	WDDM 1.1
szDriverName	nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
szDriverNodeStrongName	oem187.inf:NVIDIA_SetA_Devices.NTamd64.6.1:Section132:\ven_10de&dev_0dda&subsys_21cf17aa
szDriverVersion	9.18.0013.0593
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{BDC3809A-1A70-480A-95A5-E9BC1AA61FF7}\0000
szManufacturer	NVIDIA
szMiniVdd	n/a
szMiniVddDateEnglish	n/a
szMiniVddDateLocalized	n/a
szMonitorName	ThinkPad Display 1920x1080
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Supported
szRankOfInstalledDriver	00E00001
szRevisionId	0x00A1
szSubSysId	0x21CF17AA
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	n/a
szVendorId	0x10DE


Comment 1 by, Sep 29 2012

Labels: -Area-Undefined Area-Internals Internals-Graphics Feature-GPU-Video Feature-GPU-WebGL OS-Windows
Status: Untriaged
Failure is specific to Windows. Doesn't happen on Mac OS for example.

Unclear what changed to break this. ANGLE? Was there introduction of HW accelerated video decoding in M22?

Comment 2 by, Sep 29 2012

It's related to the introduction of hardware accelerated video decoding. Disabling that option in about:flags gets the video playing again. @fischman, who could help triage this?

Labels: Feature-Media-Video
Summary: HW video decode breaks <video> frame grabbing for 2d canvas and WebGL
HW decode decodes directly to RGBA textures in the GPU process, which are then unavailable to the renderer other than as opaque texture ids (which are passed around the compositor and then back to the GPU process for rendering).  We don't have a readback path for the renderer in this case, and my guess is that this codepath is taken in these demos:
(because the video_frame->format() is NATIVE_TEXTURE, not YV12 or YV16).  I hadn't considered the use-case of grabbing frames out of HW-decoded <video> to paint to canvas/webgl.

@kbr: Does it make sense to add a bind-a-given-texture-to-FBO + ReadPixels it to renderer memory?
Or is there a more anonymous way to go so that the SkCanvas being painted into can merely refer to the opaque texture id as far as webkit/media goes, but in a way that is useful to the consumers of the SkCanvas?

Labels: OS-Chrome

Comment 5 by, Sep 29 2012

Labels: -Pri-2 Pri-1 Mstone-23
Status: Assigned
@fischman: thanks for the analysis.

WebCore's HTMLVideoElement::paintCurrentFrameInContext needs to continue to obey its contract, which it sounds like it clearly isn't. We would definitely like to accelerate the upload path from HTMLVideoElement to WebGL texture further by doing a GPU-to-GPU blit, but first the regression has to be fixed.

I'm taking the liberty of assigning this bug to you and raising it to P1 because it represents a regression that was only caught by end users once the code reached Chrome stable. We need to add tests for this code path.

Comment 6 by, Sep 29 2012

Labels: -Type-Bug Type-Regression
Status: Started
WIP CL illustrating my intent from #3 is in (but doesn't work yet :().

Comment 8 by, Sep 29 2012

Why didn't the GPU bots notice this? Do we need a configuration that enables video acceleration? This test apparently fails on M22

Do we have tests for this functionality?  If so, do any of our bots actually run with h/w accelerated video enabled? 

We have no bots that have HW decode enabled, yet.
We have manual tests, but obvs. we missed this use-case.
The gpu bots should have the necessary hardware and drivers to run these tests. Can we look at enabling them there? 
Win7 HW decode is through DXVA, which only supports decoding h264 (not vp8 or theora).
The chromium (not Chrome-branded) build of the browser/DumpRenderTree/content_shell/etc doesn't include support for h.264.

If the GPU bots also built/ran with $GYP_DEFINES of:
branding=Chrome ffmpeg_branding=Chrome proprietary_codecs=1
I suspect we'd see these failures on the bots (which would be awesome).

Is that an option?
 Issue 152300  has been merged into this issue.

Comment 14 by, Oct 1 2012

The video related tests are flaky on Windows, so we disabled them a while back (very unfortunate indeed)


Comment 15 Deleted

Karen: heads-up: once lands and looks good on canary, I'm going to want to merge this back to 23 & 22.  I think it's a minimal-risk change.
Project Member

Comment 17 by, Oct 1 2012

 Issue 150806  has been merged into this issue.
 Issue 150806  has been merged into this issue.
Project Member

Comment 20 by, Oct 3 2012

The following revision refers to this bug:

r159842 | | 2012-10-03T05:50:29.037365Z

Changed paths:

ReadPixels from known-usable textures, and give SkBitmap its precious BGRA.

BUG= 153094 

Review URL:
Labels: Merge-Requested
Requesting merge of r159571 and r159842 into M22 & M23 branches.
 Issue 153651  has been merged into this issue.
 Issue 153634  has been merged into this issue.

Comment 24 by, Oct 4 2012

Labels: -Mstone-22 Mstone-23
We've missed the deadline for 22, moving to 23.
Labels: -OS-Chrome
Summary: HW video decode breaks h.264 <video> frame grabbing for 2d canvas and WebGL
Per convos w/ kbr@ & gman@: not happy w/ leaving stable broken for a month, but can live with it.

Per IM convo w/ kareng@: 
- Removing OS-Chrome; the 23 merge will be fueled by the OS-Windows impact
- Will keep watching canary for breakages
- Assuming happiness, will merge to m23 in a week (oct 11 or 12).

Thanks Ami.  Just to verify, this breaks both 2d canvas and webgl? 
@vangelis: yes, it breaks upload of video frames to both 2d and webgl; see original report for examples. 
FWIW, it only affects video sources that are h264 (since that's the only codec DXVA handles).

Comment 28 by, Oct 5 2012

Ami, Vangelis and I discussed this over lunch and we both think that if the path from video elements to 2D canvas is broken too then HW accelerated video decode should be disabled by default in M22. There are likely to be many more web sites using video with 2D canvas right now than WebGL (although I can't point to any off the top of my head).

@kbr/vangelis: yer killin' me here...
All of the reported breakages so far are in example/demo sites; does that observation change your assessment of the impact?
Hi Regarding comment 28 and 29.
We do use this feature in a production system, it is not a demo website. It is a product for healthcare.  If you like I can give you a demo, but I'll need an NDA.
@vittorio.accomazzi: thanks for letting us know.  OOC are you using canvas or webgl?

@kerz: what's the SOP for this sort of thing?  Just land the change on the branch directly?  Sent out
We use canvas
Project Member

Comment 33 by, Oct 5 2012

Labels: merge-merged-1229
The following revision refers to this bug:

r160405 | | 2012-10-05T17:14:45.180306Z

Changed paths:

Disable HW video decode on m22 branch.

BUG= 153094 
Review URL:
HW decode disabled on m22 branch.

Per IM convo w/ kerz@, there are no more *currently scheduled* releases of m22 this could go out in.  If another release does get scheduled, it'll likely be ~2w before 23 rolls to stable.

Comment 35 by, Oct 10 2012

Labels: -Merge-Requested Merge-Approved
Project Member

Comment 36 by, Oct 10 2012

Labels: -Merge-Approved merge-merged-1271
The following revision refers to this bug:

r161172 | | 2012-10-10T20:19:51.239425Z

Changed paths:

Merge 159571 - Support reading pixels from HW-decoded video textures into canvas/webgl.

BUG= 153094 

Review URL:
Review URL:
Project Member

Comment 37 by, Oct 10 2012

The following revision refers to this bug:

r161173 | | 2012-10-10T20:20:31.018683Z

Changed paths:

Merge 159842 - ReadPixels from known-usable textures, and give SkBitmap its precious BGRA.

BUG= 153094 

Review URL:
Review URL:
Status: Fixed
Status summary:
- Fixed in dev/canary channels (m24)
- Fixed in m23 branch; expect release to beta channel in the next week(ish)
- Disabled in m22 branch; unclear whether that branch will see another release to stable channel before m23 rolls to stable.  If such a release happens, HW decode will be disabled in it, and the bug will not surface; if such a release does not happen, this bug will not be fixed for stable channel users until m23 goes stable.
Project Member

Comment 39 by, Mar 9 2013

Labels: -Feature-GPU -Type-Regression -Area-Internals -Internals-Graphics -Feature-GPU-Video -Feature-GPU-WebGL -Feature-Media-Video -Mstone-23 Cr-Internals-GPU-WebGL Type-Bug-Regression M-23 Cr-Internals-GPU Cr-Internals-Graphics Cr-Internals Cr-Internals-Media-Video Cr-Internals-GPU-Video
Project Member

Comment 40 by, Apr 10 2013

Labels: -Cr-Internals-GPU-WebGL Cr-Blink-WebGL
Components: -Internals>Graphics
Moving old issues out of Internal>Graphics to delete this obsolete component (  for details)

Sign in to add a comment