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

Issue 901664 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

WebM / VP9 video displays wrong colors when RGB color space is used

Reported by kari.pih...@gmail.com, Nov 4

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Open the attached webm video file in Chrome
2. Observe the colors

What is the expected behavior?
The colors in the video should match the colors in the reference frame-000000.png image (provided as an attachment).

What went wrong?
The colors in the video are not rendered correctly.

Did this work before? No 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? N/A

Chrome version: 70.0.3538.77  Channel: stable
OS Version: OS X 10.14.1
Flash Version: 

Contents of chrome://gpu: 

Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Out-of-process Rasterization: Disabled
Hardware Protected Video Decode: Unavailable
Rasterization: Hardware accelerated
Skia Deferred Display List: Disabled
Skia Renderer: Disabled
Surface Synchronization: Enabled
Video Decode: Hardware accelerated
Viz Service Display Compositor: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
add_and_true_to_loop_condition
adjust_src_dst_region_for_blitframebuffer
decode_encode_srgb_for_generatemipmap
disable_2d_canvas_auto_flush
disable_framebuffer_cmaa
disable_webgl_rgb_multisampling_usage
dont_use_loops_to_initialize_variables
emulate_abs_int_function
get_frag_data_info_bug
init_two_cube_map_levels_before_copyteximage
max_msaa_sample_count_4
msaa_is_slow
pack_parameters_workaround_with_pack_buffer
rebind_transform_feedback_before_resume
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
reset_teximage2d_base_level
rewrite_texelfetchoffset_to_texelfetch
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
unpack_image_height_workaround_with_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
Problems Detected
Protected video decoding with swap chain is for Windows and Intel only
Disabled Features: protected_video_decode
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Multisample renderbuffers with format GL_RGB8 have performance issues on Intel GPUs.: 607130
Applied Workarounds: disable_webgl_rgb_multisampling_usage
Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
glResumeTransformFeedback works incorrectly on Intel GPUs: 638514
Applied Workarounds: rebind_transform_feedback_before_resume
Result of abs(i) where i is an integer in vertex shader is wrong: 642227
Applied Workarounds: emulate_abs_int_function
Rewrite texelFetchOffset to texelFetch for Intel Mac: 642605
Applied Workarounds: rewrite_texelfetchoffset_to_texelfetch
Rewrite condition in for and while loops for Intel Mac: 644669
Applied Workarounds: add_and_true_to_loop_condition
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Init first two levels before CopyTexImage2D for cube map texture on Intel Mac 10.12: 648197
Applied Workarounds: init_two_cube_map_levels_before_copyteximage
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
Tex(Sub)Image3D performs incorrectly when uploading from unpack buffer with GL_UNPACK_IMAGE_HEIGHT greater than zero on Intel Macs: 654258
Applied Workarounds: unpack_image_height_workaround_with_unpack_buffer
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Reset TexImage2D base level to 0 on Intel Mac 10.12.4: 705865
Applied Workarounds: reset_teximage2d_base_level
Shader variable initialization in a loop caused perf regression on Mac Intel.: 809422
Applied Workarounds: dont_use_loops_to_initialize_variables
8x MSAA is slow for alpha:false WebGL contexts on Mac Intel: 812071
Applied Workarounds: max_msaa_sample_count_4
glFlush error on Mac: 841755
Applied Workarounds: disable_2d_canvas_auto_flush
Viz service display compositor is not enabled by default.
Disabled Features: viz_display_compositor
Skia renderer is not used by default.
Disabled Features: skia_renderer
Skia deferred display list is not used by default.
Disabled Features: skia_deferred_display_list
Version Information
Data exported	2018-11-04T12:26:29.451Z
Chrome version	Chrome/70.0.3538.77
Operating system	Mac OS X 10.14.1
Software rendering list URL	https://chromium.googlesource.com/chromium/src/+/0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9/gpu/config/software_rendering_list.json
Driver bug list URL	https://chromium.googlesource.com/chromium/src/+/0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9/gpu/config/gpu_driver_bug_list.json
ANGLE commit id	05c729f336ef
2D graphics backend	Skia/70 193565807f7fd2a2c14e21b44c545cc03ebe134f-
Command Line	/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --flag-switches-begin --flag-switches-end
Driver Information
Initialization time	266
In-process GPU	false
Passthrough Command Decoder	false
Sandboxed	true
GPU0	VENDOR = 0x8086 [Intel Inc.], DEVICE= 0x0166 [Intel HD Graphics 4000 OpenGL Engine] *ACTIVE*
Optimus	false
AMD switchable	false
Driver vendor	INTEL
Driver version	12.2.17
Driver date	
GPU CUDA compute capability major version	0
Pixel shader version	4.10
Vertex shader version	4.10
Max. MSAA samples	8
Machine model name	MacBookAir
Machine model version	5.2
GL_VENDOR	Intel Inc.
GL_RENDERER	Intel HD Graphics 4000 OpenGL Engine
GL_VERSION	4.1 INTEL-12.2.17
GL_EXTENSIONS	GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Disabled WebGL Extensions	
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x0000
GPU process crash count	0
Compositor Information
Tile Update Mode	Zero-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
R_16	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
BGRX_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_1010102	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBX_1010102	Software only
BGRA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBA_F16	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420	Software only
YUV_420_BIPLANAR	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
Display(s) Information
Info	Display[69680128] bounds=[0,0 1440x900], workarea=[0,23 1440x877], scale=1, external.
Color space information	{primaries_d50_referred: [[0.5932, 0.3496], [0.3542, 0.5676], [0.1589, 0.1043]], transfer:0.0777*x + 0.0000 if x < 0.0450 else (0.9478*x + 0.0521)**2.4000 + -0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Info	Display[418334593] bounds=[1440,0 1920x1200], workarea=[1440,23 1920x1177], scale=1, external.
Color space information	{primaries:BT709, transfer:IEC61966_2_1, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Video Acceleration Information
Decode h264 baseline	up to 4096x2160 pixels
Decode h264 extended	up to 4096x2160 pixels
Decode h264 main	up to 4096x2160 pixels
Decode h264 high	up to 4096x2160 pixels
Encode h264 baseline	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 main	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 high	up to 4096x2160 pixels and/or 30.000 fps

The VP9 video uses the RGB color space and the sRGB color profile (VP9 profile 1). The red, green and blue colors seem to be mapped to wrong channels. I've attached the source image, the webm video, and a screenshot of Chrome playing the video.

The video was encoded using ffmpeg 4, libvpx 1.7.0 using the following command:

ffmpeg -framerate 10 -f image2 -i colortest/frame-%06d.png -c:v libvpx-vp9 -colorspace rgb -pix_fmt bgr0 -lossless 1 colortest.webm

I don't actually know if this is a bug in ffmpeg encoding or Chrome decoding the video. The problem can be any of these:

1. I have used wrong parameters for ffmpeg
2. ffmpeg has a bug
3. Chrome has a bug

It has been difficult to find a reference VP9 video with the RGB color space (profile 1). I found few VP9 test bitstreams, but they are only for profile 0 and 2: https://www.webmproject.org/vp9/levels/

If you think that Chrome is correct, then just let me know and I'll get ffmpeg sorted out.
 
colortest.webm
102 KB View Download
frame-000000.png
114 KB View Download
chrome-screenshot.png
62.8 KB View Download
Labels: Needs-Triage-M70
Cc: vamshi.kommuri@chromium.org
Labels: Needs-Feedback Triaged-ET
Thanks for filing the issue!

@Reporter: Could you please share a sample test file which helps us to triage this further in a better way, as "colortest.webm" seems to be a recording explaining the issue. Any further inputs from your end may be helpful. 
Thanks for looking into this. "colortest.webm" is the sample test file. It is a WebM file containing a VP9 bitstream, which is encoded using the RGB color space. If you open it in Chrome, the colors are not displayed correctly. If you open it in the VLC media player, then the colors are correct.

I think that VLC is displaying the colors correctly, because it uses the same library as ffmpeg. So, the issue is either in ffmpeg or Chrome.

If you want to have more sample test files, I can create them with ffmpeg.

Project Member

Comment 4 by sheriffbot@chromium.org, Nov 5

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I uploaded another test file "bigbucks-vp9-rgb-10s.webm".

It is a 10 second clip from Big Bucks Bunny. It is a WebM video with VP9 codec in the RGB color space without audio. VLC plays it correctly. Chrome displays wrong colors.
bigbucks-vp9-rgb-10s.webm
6.5 MB View Download
I created the "bigbucks-vp9-rgb-10s.webm" test file myself using ffmpeg like this:

ffmpeg -i bigbucks.mp4 -c:v libvpx-vp9 -colorspace rgb -pix_fmt gbrp -an -lossless 1 bigbucks-vp9-rgb-10s.webm

Again, either ffmpeg is encoding wrong or Chrome is playing wrong.

Cc: ccameron@chromium.org
Owner: hubbe@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Started (was: Assigned)
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 13

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

commit feeeabcd597dd1201294fca43f5e98ddca79fa04
Author: Fredrik Hubinette <hubbe@google.com>
Date: Tue Nov 13 02:11:18 2018

Handle RGB video correctly.

Turns out that when a video is tagged as RGB,
they really mean that the Y channel contains green,
Cr contains red, and Cb contains blue.
(According to ISO 23001-8:2016)

Bug:  901664 
Change-Id: I468327252389dc2468020f23a912129fdc55574a
Reviewed-on: https://chromium-review.googlesource.com/c/1321582
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Fredrik Hubinette <hubbe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607442}
[modify] https://crrev.com/feeeabcd597dd1201294fca43f5e98ddca79fa04/media/base/video_color_space.cc
[modify] https://crrev.com/feeeabcd597dd1201294fca43f5e98ddca79fa04/ui/gfx/color_space.cc
[modify] https://crrev.com/feeeabcd597dd1201294fca43f5e98ddca79fa04/ui/gfx/color_space.h
[modify] https://crrev.com/feeeabcd597dd1201294fca43f5e98ddca79fa04/ui/gfx/color_space_win.cc

Status: Fixed (was: Started)
This is fixed - in most cases. It's likely that there are some platforms/hardware combinations where this doesn't work properly.

Labels: TE-Verified-M72 TE-Verified-72.0.3610.0
Verified the fix on Mac 10.13.1 using Chrome version #72.0.3610.0 as per the comment #0.
Attaching screen cast for reference.
Observed the colours displayed were correct.
Hence, the fix is working as expected. 
Adding the verified labels.
Note: Able to reproduce the issue on chrome version with out fix.

Thanks...!!
901664.mp4
909 KB View Download

Sign in to add a comment