Closed kalradivyanshu closed 1 year ago
This seems like a chromium bug, please file at https://crbug.com/new -- I suspect you need HDR canvas enabled to work with HDR content. I don't think we have a tone-mapping stage in the draw path otherwise.
So from what I understand for HDR to be properly displayed on canvas, https://github.com/w3c/ColorWeb-CG/blob/master/hdr_html_canvas_element.md (chrome_bug) this needs to be implemented by browsers? In the meanwhile is there any other way to programmatically change HDR videoframe to SDR for better colors?
Yes that's correct AFAIK.
You'd need your own tone mapping shader you apply with WebGL/WebGPU. You can see Chrome's here: https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/color_transform.cc;l=1138?ss=chromium&q=ToneMap
Great! thanks 🙌
I cloned this repo and ran the webcodec video decode display sample, it worked fine for the provided 720p video, I wanted to push it so I got a 4k video (attached below) and it was okayish for 2D, webgl and webGL2 but for WebGPU the video is undersaturated and bright. For WebGL/2D the colors were muted and a bit off, but for WebGPU it looked really bad:
Original:![image](https://user-images.githubusercontent.com/12642750/232484594-7649eee6-6429-41f4-9f51-99b59383dc8e.png)
WebGL2:![image](https://user-images.githubusercontent.com/12642750/232482164-8b371f7f-4e49-4d77-ad80-eedc780124b4.png)
WebGPU:![image](https://user-images.githubusercontent.com/12642750/232482219-fb907331-4e5d-4c52-b47c-ddcf028414f6.png)
Original:![image](https://user-images.githubusercontent.com/12642750/232484512-90900c39-088d-47a1-8799-2e3b83a16679.png)
WebGL2:![image](https://user-images.githubusercontent.com/12642750/232482345-c03d16e3-11eb-47f9-8993-e219f24c4154.png)
WebGPU:![image](https://user-images.githubusercontent.com/12642750/232482474-3483bcc6-0b56-4896-ab6d-12bb07da16db.png)
Steps to reproduce:
Maybe this is an issue with mp4box? Is it an issue with webcodec or in the rendering step?
Browser version: Microsoft Edge | 113.0.1774.9 (Official build) beta (64-bit) Revision | 75fed22f252b880b85dc803f70378286843487c5 Chromium version | 113.0.5672.24 Operating system | Windows 11 Version 22H2 (Build 22621.1555) JavaScript | V8 11.3.10.3
GPU info: Graphics Feature Status.txt