Opened 6 years ago
Last modified 4 years ago
#7756 new enhancement
add mastering display color volume and content light level information to hevc_metadata bitstream filter
Reported by: | sneaker | Owned by: | |
---|---|---|---|
Priority: | wish | Component: | avcodec |
Version: | git-master | Keywords: | hevc |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
It's currently already possible to use the "hevc_metadata" bitstream filter (-bsf:v hevc_metadata) to add or change colour_primaries, transfer_characteristics and matrix_coefficients of a given HEVC bitstream losslessly. The only things missing to allow ffmpeg to properly set HDR metadata on existing HEVC streams would be to set SMPTE ST 2086 Mastering display color volume SEI and Content light level information SEI message (MaxCLL and MaxFALL).
This is useful because not all encoders currently allow setting those as well as in the case you forgot setting them during encode time.
Maybe patch below can meet your demand.
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20201229035649.5612-1-kloblic@gmail.com
ffmpeg command:
ffmpeg -i HDR_X265_master2.mp4 -vcodec hevc_nvenc -bsf:v hevc_metadata=transfer_characteristics=16:colour_primaries=9:video_full_range_flag=0:matrix_coefficients=9:max_cll="1000|1000":master_display="G(13250|34500)B(7500|3000)R(34000|16000)WP(15635|16450)L(10000000|100)" with_sei_video_265.mp4 -y
And here is fork release.
https://github.com/klob/FFmpeg/releases/tag/release-hevc_nvenc_hdr_sei