HandBrakeCLI -i input.mkv -o output.mp4 \
--encoder x265 \
--quality 22 \
--color-space bt709 \
--color-tranfer bt709 \
--color-primaries bt709 \
--tonemap hable \
--rate 30 \
--cfr
This feature should be integrated into HandBrake's Preset system.
Click Start Encode at the top. Expectation: This will be slow. Converting HDR to SDR is computationally heavy. A 2-hour movie on a modern 6-core CPU takes 2-4 hours.
A dedicated SDR Conversion group box containing:
HandBrake must analyze the source stream metadata:
BT.709 color space, the Tone Mapping prompt should appear.For batch processing or automation via the command line, the following flags are essential.
Command Example:
HandBrakeCLI -i "input.mkv" -o "output.mp4" \
-e x264 -q 20 \
--colorspace bt709 \
--colorprim bt709 \
--transfer bt709 \
--colormatrix bt709
The feature should utilize the zscale or tonemap_opencl (for hardware acceleration) video filters in the encoding pipeline.
Proposed Filter Chain (FFmpeg equivalent): If the user checks "Enable Tone Mapping" with BT.2390 algorithm:
zscale=t=linear:npl=100,tonemap=bt2390:desat=0,zscale=t=bt709:m=bt709:r=tv
Hardware Acceleration Support: