From 90f98ba38c4b0a5753b945303b1e33189899761e Mon Sep 17 00:00:00 2001 From: Antoine Van Elstraete Date: Sun, 22 Mar 2026 23:41:43 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20d=C3=A9tection=20Dolby=20Vision=20avec?= =?UTF-8?q?=20avertissement=20(fallback=20HDR10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- vid_convert.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vid_convert.py b/vid_convert.py index 0eb3214..c5c08dd 100755 --- a/vid_convert.py +++ b/vid_convert.py @@ -76,6 +76,18 @@ def get_infos(file): hdr10_cmd_res = subprocess.getoutput(hdr10_cmd) logging.debug(hdr10_cmd_res) v_infos.update({'hdr10plus': True, 'hdr10plus_metadata': f'/tmp/{file}_hdr10_metadata.json'}) + try: + for side_data in full_v_infos['frames'][0].get('side_data_list', []): + if side_data.get('side_data_type') == 'DOVI configuration record': + dv_profile = side_data.get('dv_profile', '?') + logging.warning( + f"Dolby Vision détecté (Profile {dv_profile}). " + f"Encodage sans couche DV — HDR10 utilisé si disponible." + ) + v_infos.update({'dolby_vision_profile': dv_profile}) + break + except (KeyError, IndexError): + pass infos = {'duration': duration, 'video': v_infos, 'audio': a_infos, 'subtitles': s_infos} logging.debug("Informations du film : \n" + json.dumps(infos, indent=True)) return infos