FFMPEG / ACES workflow for SDR and HDR deliverables


(Marco Sgorbati) #1

Hi everyone, I’m a new member so please forgive my unsuitable-like questions :slight_smile:

I want to render in Resolve (ACES color science 1.0.3) 2 masters:

  1. EXR ACEScc as intermediate
  2. EXR ACES2065 for log-term storage

I’m trying compile a script in FFMPEG to convert EXR ACEScc intermediate into deliverables (sRGB h264 SDR 1080p, bt2020 h265 4k hdr10 and so on…) but FFMPEG does not work with EXR ACEScc when converting in h265, even with correct master display params set and baked LUT from OpenColorIO applied.
The point is that FFMPEG does not recognize AP0 and AP1 primaries or ACES input stream, so the x265 matrix correction does not work properly. old h264 codec works fine but is not 2020 HDR. Here 2 screenshot:


FFMPEG x265 HDR from ACEScc


FFMPEG h264 sRGB with no LUT applied

I found a solution rendering a ProRes in 2020 HDR and making h265 deliverables from that.
Does any one know a way to use x265 FFMPEG with ACEScc intermediate and not the ProRes?
THX a lot :slight_smile:


(Elliott Balsley) #2

What ffmpeg command have you tried?


(Marco Sgorbati) #3

assuming
INPUT = ProRes 4444XQ, 4k dci scope 2.39, bt2020, st2084, 1000nits, level “auto”
this very basic version of the syntax works well (vimeo hdr flag is ok):

ffmpeg -i INPUT -c:v libx265 -x265-params “colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:max-cll=1000,400:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,0.0050)” OUTPUT


(Walter Arrighetti) #4

First of all- the upper screenshot indicates that the pipeline has some implicit conversion into a YUV-model colorspace that is not properly round-tripped back; I think this should be addressed first.

Second- you shouldn’t be using ACEScc at all in any rendered file. ACEScc is only to be used internally by the color-grading software (Resolve in your case, when you select ACEScc in the Color Management options). All your rendered files should be in ACES2065-1 colorspace.

Third- What LUT are you using from OpenColorIO for mapping into the output colorspace of your choice? Converting from AP0 primaries to BT709 (sRGB) or BT2020 (HDR) primaries can be easily done using ffmpeg's command-line; the same goes from ACES2065-1 (linear characteristics) into BT1886 or ST2084 gamma. Using a LUT from OpenColorIO might still be more accurate though (I’m not sure what equations ffmpeg is using)