flowframes icon indicating copy to clipboard operation
flowframes copied to clipboard

HDR is not encoded

Open ensingerphilipp opened this issue 3 years ago • 5 comments

When interpolating a MKV File with HDR information as a source. The resulting MKV File is missing the HDR Data which leads to wrong colors displayed.

ensingerphilipp avatar Mar 21 '21 11:03 ensingerphilipp

HDR is currently not supported as the neural networks only work with 8bpp content.

I can't say if there will ever be HDR support.

n00mkrad avatar Mar 21 '21 12:03 n00mkrad

OpenCV supports tonemapping, so it may be possible to recognize or ask if a file has HDR information, convert it to 8 bit using tonemapping, and outputting the SDR interpolated file. At least this would preserve the color information even if it wasn't HDR.

OpenSourceAnarchist avatar Apr 20 '21 19:04 OpenSourceAnarchist

OpenCV supports tonemapping, so it may be possible to recognize or ask if a file has HDR information, convert it to 8 bit using tonemapping, and outputting the SDR interpolated file. At least this would preserve the color information even if it wasn't HDR.

This is something I'm working on - Automatically detecting HDR content and tonemapping to SDR using FFmpeg. It's planned for 1.25.

n00mkrad avatar Apr 20 '21 20:04 n00mkrad

@n00mkrad you can detect the hdr from ffprob track info, search for bt2020:colormatrix=bt2020nc:transfer=smpte2084

Using ffmpeg you can convert the exported file again to have hdr support but for sure its better to have this automatically in the app itself optionally use -crf ffmpeg -i "in.mkv" -vcodec libx265 -x265-params "level=5.2:colorprim=bt2020:colormatrix=bt2020nc:transfer=smpte2084" "out.mkv"

wnabil avatar Jul 27 '21 11:07 wnabil