Gracefully handle missing VideoRangeType in stream tracks

This commit is contained in:
Odd Stråbø 2024-04-09 03:42:58 +02:00
parent 04551f7925
commit bc8cae9850

View File

@ -75,15 +75,10 @@ class API(object):
if "DvProfile" in track:
track['hdrtype'] = "dolbyvision"
elif track['VideoRangeType'] in ["HDR10", "HDR10Plus"]:
elif track.get('VideoRangeType', '') in ["HDR10", "HDR10Plus"]:
track['hdrtype'] = "hdr10"
elif "HLG" in track['VideoRangeType']:
elif "HLG" in track.get('VideoRangeType', ''):
track['hdrtype'] = "hlg"
elif track['VideoRangeType'] in ["SDR", "Unknown"]:
track['hdrtype'] = ""
track.update({
'hdrtype': track.get('hdrtype', "").lower(),