From 71f0cc292bad9c339e3631026b59c91fc6c81de4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 1 Feb 2021 16:13:16 +0100 Subject: [PATCH 1/2] stream data are stored to ffprobe_data variable --- pype/scripts/otio_burnin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pype/scripts/otio_burnin.py b/pype/scripts/otio_burnin.py index 4f5c290e9d..517ef1c7f4 100644 --- a/pype/scripts/otio_burnin.py +++ b/pype/scripts/otio_burnin.py @@ -543,21 +543,22 @@ def burnins_from_data( ffmpeg_args = codec_data else: - codec_name = burnin._streams[0].get("codec_name") + ffprobe_data = burnin._streams[0] + codec_name = ffprobe_data.get("codec_name") if codec_name: ffmpeg_args.append("-codec:v {}".format(codec_name)) - profile_name = burnin._streams[0].get("profile") + profile_name = ffprobe_data.get("profile") if profile_name: # lower profile name and repalce spaces with underscore profile_name = profile_name.replace(" ", "_").lower() ffmpeg_args.append("-profile:v {}".format(profile_name)) - bit_rate = burnin._streams[0].get("bit_rate") + bit_rate = ffprobe_data.get("bit_rate") if bit_rate: ffmpeg_args.append("-b:v {}".format(bit_rate)) - pix_fmt = burnin._streams[0].get("pix_fmt") + pix_fmt = ffprobe_data.get("pix_fmt") if pix_fmt: ffmpeg_args.append("-pix_fmt {}".format(pix_fmt)) From 4e971ffb67dba60164ca60427dc807a761fcf637 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 1 Feb 2021 16:14:58 +0100 Subject: [PATCH 2/2] prores codec name checks tags in stream data for different codecs --- pype/scripts/otio_burnin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pype/scripts/otio_burnin.py b/pype/scripts/otio_burnin.py index 517ef1c7f4..dec1ad1dbd 100644 --- a/pype/scripts/otio_burnin.py +++ b/pype/scripts/otio_burnin.py @@ -546,6 +546,14 @@ def burnins_from_data( ffprobe_data = burnin._streams[0] codec_name = ffprobe_data.get("codec_name") if codec_name: + if codec_name == "prores": + tags = ffprobe_data.get("tags") or {} + encoder = tags.get("encoder") or "" + if encoder.endswith("prores_ks"): + codec_name = "prores_ks" + + elif encoder.endswith("prores_aw"): + codec_name = "prores_aw" ffmpeg_args.append("-codec:v {}".format(codec_name)) profile_name = ffprobe_data.get("profile")