WebM VP9 with RGB colorspace wrong everywhere?

1,489 views
Skip to first unread message

kari.p...@gmail.com

unread,
Sep 13, 2018, 12:04:51 PM9/13/18
to WebM Discussion
I encoded a WebM / VP9 file with the RGB colorspace with ffmpeg 4.0. If I play it back on Google Chrome 71, MS Edge 17, Firefox 64 and Google Drive, I get different results:

 * Google Chrome displays the colors wrong - the color channels seem to be in the wrong order.
 * Microsoft Edge displays the colors wrong - it is hard to say what it is trying to do.
 * Firefox claims that the file is corrupt.
 * I uploaded the video to Google Drive and it decodes and encodes the video to something else (H.264?) and the resulting colors look correct in its video preview. Google Drive may be using ffmpeg under the hood to do the transcoding and that might be the reason why a video encoded with ffmpeg looks correct.

My problem is that I don't know which one is correct: ffmpeg encoding/decoding, Google Chrome or MS Edge? Which ones should receive bug reports?

Are there any sample WebM RGB files, which I could use to test these different platforms?

This is the command I used to create the WebM file with ffmpeg from 8-bit RGB PNG files:

ffmpeg -framerate 10 -i frames/frame-%05d.png -c:v libvpx-vp9 -colorspace rgb -pix_fmt bgr0 -lossless 1 output.webm

 - Kari

Brion Vibber

unread,
Oct 1, 2018, 3:19:51 PM10/1/18
to webm-d...@webmproject.org
Hi Kari --

As I recall VP9's RGB mode is under profile 1 (along with features like 4:2:2 and 4:4:4 YUV subsampling), which isn't supported by all players. If it converts correctly from ffmpeg and plays ok with VLC it's probably ok, but you'll have trouble playing it back in browsers because they mostly only support profile 0.

-- brion



--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To post to this group, send email to webm-d...@webmproject.org.
Visit this group at https://groups.google.com/a/webmproject.org/group/webm-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.

kari.p...@gmail.com

unread,
Nov 14, 2018, 4:40:23 AM11/14/18
to WebM Discussion
Hi Brion,

Thanks for the answer.

I filed a bug for Chrome and it has been now fixed in Chrome 72.0.3610.0 Canary: https://bugs.chromium.org/p/chromium/issues/detail?id=901664
The bug page contains few WebM / VP9 videos with the RGB color space.

So, ffmpeg is encoding correctly. It seems that the color channels should be mapped so that Y contains green, Cr contains red, and Cb contains blue, just like ISO 23001-8:2016 defines.

Best,
Kari
Reply all
Reply to author
Forward
0 new messages