You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a small bash script that can be used to compare SDR and HDR videos on an sRGB display:
#!/bin/bashusage() {
echo"Usage: $0 [OPTIONS]... <SDR FILE> <HDR FILE>"echo""echo"Note: SDR video should be in Rec. 709 and HDR video should be in e.g. Rec. 2020 + SMPTE ST 2084 (HDR10)."exit 1
}
if [ "$#"-lt 2 ];then
usage
fi# If HDR_PEAK_NITS is not set in the environment, use 850 peak nits as the default
HDR_PEAK_NITS=${HDR_PEAK_NITS:-850}# Calculate SDR tone-mapping adjustment via awk; for HDR content mastered at 850 peak nits, the value becomes ~0.118
SDR_TM_ADJUSTMENT=$(LC_ALL=C awk -v n="$HDR_PEAK_NITS"'BEGIN {print (100 / n)}')# Use Rec. 709 + sRGB for display color primaries / transfer characteristics by default
DISPLAY_PRIMARIES=${DISPLAY_PRIMARIES:-bt709}
DISPLAY_TC=${DISPLAY_TC:-iec61966-2-1}
video-compare --left-decoder :colorspace=bt709,color_primaries=bt709,color_trc=bt709 \
-l format=rgb48,zscale=t=linear,tonemap=clip:param=$SDR_TM_ADJUSTMENT,zscale=p=$DISPLAY_PRIMARIES:t=$DISPLAY_TC \
-r format=rgb48,zscale=p=$DISPLAY_PRIMARIES:t=$DISPLAY_TC:npl=$HDR_PEAK_NITS \
"$@"
This script ensures that HDR content mapped correctly for an SDR display and adjusts the SDR video accordingly to simulate the relative difference in appearance between the two videos on an HDR display. This makes the comparison between the SDR and HDR videos more accurate.
Please note:
Requires the zscale libavfilter and awk to compute the SDR tone-mapping adjustment parameter
The SDR video is assumed to be in Rec. 709 (if metadata is missing)
The HDR video must be in a format such as Rec. 2020 + SMPTE ST 2084 (PQ10/HDR10)
In the future, I am going to explore how we can have proper HDR support in video-compare.
You are welcome to suggest improvements to the approach above, and/or adapt this script into a Windows Batch file and share the outcome here.
The text was updated successfully, but these errors were encountered:
I've introduced support for the above in video-compare on the master branch today, and a couple of command-line examples have been added to the project's README.md.
Besides the HDR display relative tone-matching approach described above, video-compare now supports color space conversion to sRGB and basic tone mapping for comparing videos at the display's full light level. For this to work, zscale and valid color space metadata (which can be set via video filter options, e.g. setparams=colorspace=bt709:color_primaries=bt709:color_trc=bt709) are required. The peak content luminance in nits must be provided for HDR videos on the command line; otherwise, SDR content at 100 nits is assumed. Tested with HDR10, PQ10, and HLG.
Two HDR videos can be compared if desired, and I’ve added the option to boost the luminance of both videos via tone mapping. The latter is useful when comparing videos with vastly different dynamic ranges, and some clipping can be tolerated.
This issue will be closed when the next release is made.
P.S. Can't wait for SDL3 to be released... HDR display support here we come!
Here is a small bash script that can be used to compare SDR and HDR videos on an sRGB display:
This script ensures that HDR content mapped correctly for an SDR display and adjusts the SDR video accordingly to simulate the relative difference in appearance between the two videos on an HDR display. This makes the comparison between the SDR and HDR videos more accurate.
Please note:
zscale
libavfilter andawk
to compute the SDR tone-mapping adjustment parameterIn the future, I am going to explore how we can have proper HDR support in
video-compare
.You are welcome to suggest improvements to the approach above, and/or adapt this script into a Windows Batch file and share the outcome here.
The text was updated successfully, but these errors were encountered: