[FFmpeg-trac] #9167(undetermined:closed): Color changed when an image converting to video

FFmpeg trac at avcodec.org
Tue Mar 30 20:41:04 EEST 2021

#9167: Color changed when an image converting to video
             Reporter:  kvsico       |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:  invalid
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |

Comment (by pdr0):

 Replying to [comment:3 Balling]:
 > Replying to [comment:1 pdr0]:
 > >
 > > Not a bug.
 > >
 > > 8bit RGB vs. 8bit YUV
 > No, it has nothing to do with this. Anyway, I could not even launch the
 command, the png is too big...

 It has something to with that

 You can -vf scale...

 You're assuming that he's using a different matrix for playback ?

 One possible difference is the matrix used for YUV<=>RGB, but even if you
 use the correct matching matrix for both directions (and back to RGB for
 display), you will still get slightly off colors

 You will usually not get exact colors from 8bit RGB with 8bit YUV because
 the color models do not overlap perfectly and you will get rounding errors
 +/-3, even with correct matching matrix transform YUV<=>RGB in either

 ffmpeg -y -t 4 -loop 1 -i 1.png -vf scale=1302:2183:out_color_matrix=bt709

 It's closer, but still off

 RGB 238,77,45

 3.mp4 (8bit YUV444) converted to RGB with 709 RGB 239,78,44

 2.mp4 (libx264rgb) RGB 239,77,45

Ticket URL: <https://trac.ffmpeg.org/ticket/9167#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list