Ffmpeg - convert Aces exr sequence to h264

798 Views Asked by At

I would like to convert an exr sequence to an h264 video. This is fairly easy but the exr sequence is in [AcesCG][1] colourspace which is a colourspace created by [OCIO][2] (an open source colour management solution that has become the standard for VFX).

One solution would be to convert the exrs to a more common colourspace (e.g. srgb or rec709) using [oiio][3] and then use ffmpeg to create an h264 from those images, but that adds an extra step and will be slow. I would like to find a solution where I can directly convert the exrs into an h264 using open source software (e.g. ffmpeg)

[1]: https://en.m.wikipedia.org/wiki/Academy_Color_Encoding_System#:~:text=ACEScg%20(ACES%20computer%20graphics%20space,graphics%20rendering%20and%20compositing%20tools. [2]: https://opencolorio.org/ [3]: https://www.google.com/url?sa=t&source=web&rct=j&url=https://github.com/OpenImageIO/oiio&ved=2ahUKEwjZ9_Gc59D8AhWKdcAKHcG_CUEQFnoECDIQAQ&usg=AOvVaw27FWYrbTnUMqgfYMPRKia_

1

There are 1 best solutions below

0
On

I'm searching for the same thing. The best lead I've found is here: https://github.com/jedypod/generate-dailies

The way I understand it is that ffmpeg doesn't support OCIO transforms (even though ChatGPT thinks it does,) and the best I've gotten out of it is using this command:

ffmpeg_cmd = f"ffmpeg -gamma 2.2 -start_number {start_frame_number} -r {frame_rate} -i {input_pattern} -c:v prores_ks -profile:v 0 -color_trc bt709 -colorspace bt709 -color_primaries bt709 -y {output_file}"

That -gamma 2.2 tag seems to change the linear gamma curve of 1.0 on those dark EXRs to a more normal gamma. But it's still giving me blown out highlights, and doesn't look as good as an OCIO curve.

If you're looking to match dailies / LUTs, I think you'll need the repo above. If you just need an intermediate format for some other reason, this could do the trick.