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

FFmpeg trac at avcodec.org
Wed Mar 31 08:17:59 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 kvsico):

 Replying to [comment:22 pdr0]:
 > Replying to [comment:21 kvsico]:
 > >
 > > After using libx264rgb, I have another problem: Chorome can't play the
 video file libx264rgb.mp4, it shows a black video, here is my cmd:
 > >
 > > ffmpeg -y -t 4 -loop 1 -i 1.png -c:v libx264rgb libx264rgb.mp4.
 > >
 > If it's for chrome, chrome does not have a 10bit pipeline yet either, so
 there is no benefit
 > You would have to either use Balling's suggestion , or use a "normal"
 709  conversion for AVC.  Eitherway, if you test a bunch of colors, they
 will be off slightly from expected rounding errors during the 8bit
 RGB=>YUV=>RGB round trip
 > "normal" 709
 > ffmpeg -y -t 4 -loop 1 -i 1.png -vf out_color_matrix=bt709 -x264opts
 colormatrix=bt709 709.mp4
 > Balling's suggestion
 > ffmpeg -y -t 4 -loop 1 -i 1.png -color_primaries bt709 -color_trc
 iec61966_2_1 -colorspace smpte170m 2.mp4
 > You might be able to use VP9 in RGB mode, not sure if chrome supports
 it, I'll check later

 ffmpeg -y -t 4 -loop 1 -i 1.png -vf out_color_matrix=bt709 -x264opts
 colormatrix=bt709 709.mp4, this command throw error `No such filter:
 'out_color_matrix'` , so I changed to

 ffmpeg -y -t 4 -loop 1 -i 1.png -vf scale=out_color_matrix=bt709
 -x264opts colormatrix=bt709 709.mp4, then 709.mp4 generated successfully.
 I tested 709.mp4 and 2.mp4
 from the two commands, their color is #ee4d2c and have same color as
 1.png, this problem is solved, thanks to all of you.

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

More information about the FFmpeg-trac mailing list