- Posts: 542
- Joined: Sat Apr 14, 2018 4:59 pm
- Real Name: Tom Roper
Andrew Kolakowski wrote:You can't use bsf filter for this (not supported yet). You need to add it during main encode.
I used x265 binaries, not ffmpeg. Not sure if official ffmpe has been compiled with hdr10+ option. You need special setting during compile to have it included.
With x265 you just simply add --dhdr10-info and point to json file.
--dhdr10-info seems to be included in the ffmpeg builds and probably has been for a while, it's been in x265 since version 2.4.
Anyway, try this (it works if your syntax is perfect):
ffmpeg -i input -c:v libx265 -x265-params --transfer=16:--dhdr10-info=timeline.json:--fps=59.94:--input-csp=2: -b:v 15000k output
syntax is very picky, spaces and no spaces, caps and lower case, colons all critical!! So I've added a few extra x265 parameters for examples and clarity. I'm not an authority on this, but it's difficult enough with these command line compilers to not have to be stacking them to get your audio and other features muxed together. They all have similar syntax structures but just different enough to cause loss of patience. And then there is the matter of HDR10 metadata that's included in the Resolve output but not read by x265...has to all be re-included.
Now that said...I have NO IDEA how to proceed with HDR10+ dynamic metadata. I've worked with all the controls, but I can't fly the airplane. What tone mapping goes with what, on the advanced settings of the render settings, in the project settings, tone mapping preview of the color page. Are we even supposed to include the static metadata when we're attaching the JSON file? As Piotr mentions, there is precious little info in the Resolve documentation. It's almost as if BMD started by designing in all the controls they wanted to have without necessarily know how they are to be used.
It's funny, 3 days ago I did not even know Resolve exported HEVC until I stumbled over it and spilled my milk. I went to the doom9 and they were talking about it there with the same questions but had not figured how to -bsf_hevc_metadata to put in the metadata without re-encoding. So I got that working and came over here and saw you and Piotr were a month ahead with the same exact solution! It's a solution no one likes but it is hardly bad, the Nvidia hardware encoder is extremely fast. And I'm frankly not sure the BMD is to blame about the metadata not working. Could be Nvidia's fault.
But this has been helpful. The thing about it, I honestly don't feel the need for HDR10+ except for this; we can already grade scene by scene or frame by frame if we want to, and with 16 bit Sony raw there is infinite control and no concern for going out of range, so why would we grade with metadata? And the only answer I can come up with, is that you could do one color grade, and then go back and grade the metadata for each device that has a smaller color volume than the one you are working in. Is it a fool's errand? Because in a way we probably aren't going to have to deal with these sub compliant HDR devices forever. /rant_off