[FFmpeg-user] Color shift when converting static BMP/JPG image (but not PNG) to video

Benjamin Peng human.peng at gmail.com
Mon Sep 9 03:18:28 EEST 2019

I've posted this to trac but didn't get much traction (yet), and I found
this problem to be very simple but weird to happen at the same time, so I'd
like to see if anyone here have some insight.

Please read the full description here:

Simply put, if you convert a BMP image to video (tried x264 and HEVC), the
color will shifted to be slightly green-yellow-ish. Pure white
(255,255,255) will become something like 252,255,252.

(In the ticket, I added some extra parameters to make sure the video
correctly use BT.709 conversion since it's HD, but it shouldn't matter for
white color)

The most weird part of this bug is, it doesn't happen if the image is in
PNG format, which should be identical to the BMP counterpart considering
it's a lossless format.

The same bug DOES happen if you use JPG images, though.

More information about the ffmpeg-user mailing list