Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2361 from pypeclub/feature/mxf_format_support
Browse files Browse the repository at this point in the history
Burnins: Be able recognize mxf OPAtom format
  • Loading branch information
iLLiCiTiT authored Dec 2, 2021
2 parents 06d0f48 + f80a41b commit ff20e3a
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions openpype/scripts/otio_burnin.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,23 @@ def _dnxhd_codec_args(stream_data, source_ffmpeg_cmd):
return output


def _mxf_format_args(ffprobe_data, source_ffmpeg_cmd):
input_format = ffprobe_data["format"]
format_tags = input_format.get("tags") or {}
product_name = format_tags.get("product_name") or ""
output = []
if "opatom" in product_name.lower():
output.extend(["-f", "mxf_opatom"])
return output


def get_format_args(ffprobe_data, source_ffmpeg_cmd):
input_format = ffprobe_data.get("format") or {}
if input_format.get("format_name") == "mxf":
return _mxf_format_args(ffprobe_data, source_ffmpeg_cmd)
return []


def get_codec_args(ffprobe_data, source_ffmpeg_cmd):
stream_data = ffprobe_data["streams"][0]
codec_name = stream_data.get("codec_name")
Expand Down Expand Up @@ -595,9 +612,9 @@ def burnins_from_data(
if source_timecode is None:
source_timecode = stream.get("tags", {}).get("timecode")

# Use "format" key from ffprobe data
# - this is used e.g. in mxf extension
if source_timecode is None:
# Use "format" key from ffprobe data
# - this is used e.g. in mxf extension
input_format = burnin.ffprobe_data.get("format") or {}
source_timecode = input_format.get("timecode")
if source_timecode is None:
Expand Down Expand Up @@ -692,6 +709,9 @@ def burnins_from_data(
ffmpeg_args.append("-g 1")

else:
ffmpeg_args.extend(
get_format_args(burnin.ffprobe_data, source_ffmpeg_cmd)
)
ffmpeg_args.extend(
get_codec_args(burnin.ffprobe_data, source_ffmpeg_cmd)
)
Expand Down

0 comments on commit ff20e3a

Please sign in to comment.