Hi all,
Follow up to my own post. I have solved this problem and I'd like to share my results in the hopes that it helps someone else who is trying to accomplish the same goal.
The following two FFMPEG commands will transcode a 4K HDR REMUX file into a smaller file, retaining full HDR and your playing device should automatically detect HDR mode (if you have it set for that):
1) - transcode the file to crf18 and preserve HDR data:
Code: Select all
ffmpeg -i input-file.mkv -pix_fmt yuv420p10le -c:v libx265 -preset fast -crf 18 -x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)W P(15635,16450)L(10000000,500)" -y "output-file-HDR.mkv"
2) - refresh the HDR metadata so the player will automatically detect HDR mode:
Code: Select all
ffmpeg -i output-file-HDR.mkv -c copy -bsf:v hevc_metadata=colour_primaries=9:transfer_characteristics=16:matrix_coefficients=9 outputfile-HDR10.mkv
This has been working for me. All my source material appears to be HDR10, so I use 'transfer_characteristics=16'.
Along with the solution, I do have a small follow-up question: is there any way to do this in one FFMPEG command?
Thanks!
Bob