[FFmpeg-trac] #9374(undetermined:closed): mkv to mp4 has a color tint
FFmpeg
trac at avcodec.org
Sat Aug 14 11:37:16 EEST 2021
#9374: mkv to mp4 has a color tint
-------------------------------------+-------------------------------------
Reporter: razvan | Owner: (none)
Type: defect | Status: closed
Priority: normal | Component:
| undetermined
Version: git-master | Resolution: duplicate
Keywords: mp4 tint | Blocked By:
color |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Changes (by Balling):
* status: new => closed
* resolution: => duplicate
* component: ffmpeg => undetermined
Comment:
This is a duplicate of #9132.
Now, I '''will''' help you. First of all you are tagging video in limited
range RGB. I mean, that is BS, since it is actually full range. That can
be checked with ffplay rec.mkv -vf extractplanes=r (see black FFmpeg logo,
in limited range RGB black 0 is reserved and cannot be used, other colors
are also good like 247, 240, 240). Use ffmpeg -video_size 1920x1200
-framerate 25 -f x11grab -i :0.0 -vcodec libx264rgb -crf 0 -preset
ultrafast rec.mkv '''-color_range 2'''
Use this: ffmpeg -i rec.mkv -vf
scale=src_range=pc:out_color_matrix=bt709:flags=accurate_rnd -c:v libx264
-crf 10 TESTCASE-yuv.mkv -color_primaries 1 -color_trc 1 -colorspace 1
That will not be perfect since the sRGB does use -color_primaries 1
(which is BT.709) but not -color_trc 1. That is unfortunate and you can
use
ffmpeg -i rec.mkv -vf
scale=src_range=pc:out_color_matrix=bt709:flags=accurate_rnd -c:v libx264
-crf 10 TESTCASE-yuv.mkv -color_primaries 1 -color_trc iec61966_2_1
-colorspace 1
but that may be not supported in many cases. :)
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9374#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list