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: