0

I'm looking to convert a standard colour gamut video to a wide gamut video. For example, I have a 1080p, 2K or 4K H.264 8-bit mp4. This is normally (eg. from YouTube) in Rec709 or "SRGB" colour space.

I want to test my iPad Pro or other wide-gamut monitors to see what the video may look like with a wider colour gamut (eg. Rec2020) as well as save it as a H.265 10-bit mp4.

4
  • 1
    For questions you both ask and answer, please post the question and the answer separately, not both in the question
    – NoahL
    Feb 5, 2018 at 14:58
  • 1
    It's not so simple. For one, iPad Pro's color space is significantly smaller than rec.2020. If this is what you're using to "adjust to taste," then more capable displays (present or future) will expose discoloration. Feb 7, 2018 at 8:00
  • @NoahL I thought something looked weird, will change it.
    – SaltySub2
    Feb 9, 2018 at 2:34
  • @JasonConrad Fair point.
    – SaltySub2
    Feb 9, 2018 at 2:34

3 Answers 3

0

Download the relevant build for Windows, eg: https://sourceforge.net/projects/ffmpegwindowsbi/files/july-01-2016/

Use the following command line: ffmpeg -i INPUT.mp4 -c:v libx265 -crf 20 -vf eq=gamma=1.15:saturation=0.925:brightness=0.05:contrast=1.15 -color_primaries bt2020 OUTPUT.mp4

Note that you will have to adjust the various values such as brightness, contrast, saturation, etc. to your taste since this is a "brute force" conversion to wide-gamut Rec2020. This has been tested on iPad Pro with H.264 movie trailers. On wide-gamut displays such as the iPad Pro you should notice richer, deeper colours.

Note that this is not an archival or permanent solution as Rec2020 is a very wide gamut vs Display P3 (latest Apple devices) or Adobe RGB (pro wide-gamut monitors). Newer Ultra HD TV monitors or reference monitors that can get close to Rec2020 may be more suitable.

In any case I think this is an interesting experiment and learning experience for any amateur or pro who has just started exploring wide-gamut and/or HDR video... it is a very, very different world to SRGB that had been with digital media for decades. All that is about to change radically in the next 10 years.

2
  • 3
    This is an odd thing to do. Converting footage from a smaller gamut to a larger one in the way you have is not something you should ever do for comparisons. You're changing the video from how it was intended to be viewed to something else. If you want to see the difference in gamuts, you should find footage that was shot with a wider gamut and convert to the smaller gamut and compare that way. That will get you something closer to a reasonable comparison of the 2 gamuts. The way you've done it, it's just cranking up the saturation. Feb 9, 2018 at 5:42
  • I understand your point. I have evaluated things like Vimeo Vlog etc wide gamut videos on my iPad. While this method indeed ups the saturation I wanted to see if any other conversion takes place by ffmpeg itself. In general on iPad Pro Display P3 I notice an increase in saturation, but I do see colours not seen on SRGB. Interestingly from doing this process when I compare to iTunes Dolby Vision I can see similar results... Of course in the latter case it is accurately done, but as R&D I now have a glimpse into beyond-SRGB gamuts for videos. Plus they look stunning (movie trailers).
    – SaltySub2
    Feb 11, 2018 at 3:07
0

You could simply use the Colorspace Conversion LUT to convert between Rec.709 gamut and Rec.2020 gamut.

-1

BT.709 and sRGB are completly different transfer functions. Sigh.

Anyway, download ffmpeg from here: https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl-shared.zip

ffmpeg -i INPUT.mp4 -c:v libx265 -crf 20 -vf zscale=r=limited:m=2020_ncl:t=2020_10:p=2020:c=topleft,format=yuv420p10 -color_primaries bt2020 -colorspace bt2020nc -color_trc bt2020_10bit -color_range tv OUTPUT.mp4

This will preserve the same colors and will preserve SDR.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.