From 463e0ea38d676c34c3b880eea7f731788be1d5e8 Mon Sep 17 00:00:00 2001 From: Antoine Van Elstraete Date: Sun, 22 Mar 2026 23:44:44 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20r=C3=A9utilisation=20full=5Fv=5Finfos=20?= =?UTF-8?q?pour=20format/dur=C3=A9e,=20-vbsf=20=E2=86=92=20-bsf:v?= 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vid_convert.py b/vid_convert.py index ee66a0e..8f6674e 100755 --- a/vid_convert.py +++ b/vid_convert.py @@ -64,11 +64,10 @@ def get_infos(file): 'index': s_stream['index'], 'language': s_stream['tags']['language']} s_infos.append(s_stream_infos) - format_data = json.loads(subprocess.getoutput(f"ffprobe -v quiet -print_format json -show_format {file}")) - duration = float(format_data['format']['duration']) - format_name = format_data.get('format', {}).get('format_name', '') + format_name = full_v_infos.get('format', {}).get('format_name', '') + duration = float(full_v_infos['format']['duration']) is_mp4_container = 'mp4' in format_name or 'mov' in format_name - bsf = '-vbsf hevc_mp4toannexb' if is_mp4_container else '' + bsf = '-bsf:v hevc_mp4toannexb' if is_mp4_container else '' hdr10_v_cmd = f'ffmpeg -loglevel panic -i {file} -c:v copy {bsf} -f hevc - | hdr10plus_parser --verify -' hdr10_v_raw = subprocess.getoutput(hdr10_v_cmd) if 'metadata detected' in hdr10_v_raw: