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 #3049 from pypeclub/bugfix/OP-3086_FFmpeg-OP-Atom-…
Browse files Browse the repository at this point in the history
…mxf-format

Slate Review: Support to keep format on slate concatenation
  • Loading branch information
iLLiCiTiT authored Apr 12, 2022
2 parents cddd08d + a198b7f commit 8d1ded4
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions openpype/plugins/publish/extract_review_slate.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,15 @@ def process(self, instance):
])

if use_legacy_code:
format_args = []
codec_args = repre["_profile"].get('codec', [])
output_args.extend(codec_args)
# preset's output data
output_args.extend(repre["_profile"].get('output', []))
else:
# Codecs are copied from source for whole input
codec_args = self._get_codec_args(repre)
format_args, codec_args = self._get_format_codec_args(repre)
output_args.extend(format_args)
output_args.extend(codec_args)

# make sure colors are correct
Expand Down Expand Up @@ -266,8 +268,14 @@ def process(self, instance):
"-safe", "0",
"-i", conc_text_path,
"-c", "copy",
output_path
]
# NOTE: Added because of OP Atom demuxers
# Add format arguments if there are any
# - keep format of output
if format_args:
concat_args.extend(format_args)
# Add final output path
concat_args.append(output_path)

# ffmpeg concat subprocess
self.log.debug(
Expand Down Expand Up @@ -338,7 +346,7 @@ def add_video_filter_args(self, args, inserting_arg):

return vf_back

def _get_codec_args(self, repre):
def _get_format_codec_args(self, repre):
"""Detect possible codec arguments from representation."""
codec_args = []

Expand All @@ -361,13 +369,9 @@ def _get_codec_args(self, repre):
return codec_args

source_ffmpeg_cmd = repre.get("ffmpeg_cmd")
codec_args.extend(
get_ffmpeg_format_args(ffprobe_data, source_ffmpeg_cmd)
)
codec_args.extend(
get_ffmpeg_codec_args(
ffprobe_data, source_ffmpeg_cmd, logger=self.log
)
format_args = get_ffmpeg_format_args(ffprobe_data, source_ffmpeg_cmd)
codec_args = get_ffmpeg_codec_args(
ffprobe_data, source_ffmpeg_cmd, logger=self.log
)

return codec_args
return format_args, codec_args

0 comments on commit 8d1ded4

Please sign in to comment.