From 1f73b96bd053fed35c957d1c5e1d1d69fd3a4cf3 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 24 May 2021 17:40:01 +0200 Subject: [PATCH] Hiero: publishing issues - ffmpeg path with space - no need to add `ftrackreview` to tags --- .../publish/extract_otio_audio_tracks.py | 18 +++++++++--------- .../plugins/publish/extract_otio_review.py | 14 ++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/openpype/plugins/publish/extract_otio_audio_tracks.py b/openpype/plugins/publish/extract_otio_audio_tracks.py index 43e40097f7..57da6d274c 100644 --- a/openpype/plugins/publish/extract_otio_audio_tracks.py +++ b/openpype/plugins/publish/extract_otio_audio_tracks.py @@ -53,14 +53,14 @@ class ExtractOtioAudioTracks(pyblish.api.ContextPlugin): audio_inputs.insert(0, empty) # create cmd - cmd = self.ffmpeg_path + " " + cmd = '"{}"'.format(self.ffmpeg_path) + " " cmd += self.create_cmd(audio_inputs) - cmd += audio_temp_fpath + cmd += "\"{}\"".format(audio_temp_fpath) # run subprocess self.log.debug("Executing: {}".format(cmd)) openpype.api.run_subprocess( - cmd, shell=True, logger=self.log + cmd, logger=self.log ) # remove empty @@ -97,17 +97,17 @@ class ExtractOtioAudioTracks(pyblish.api.ContextPlugin): audio_fpath = self.create_temp_file(name) cmd = " ".join([ - self.ffmpeg_path, + '"{}"'.format(self.ffmpeg_path), "-ss {}".format(start_sec), "-t {}".format(duration_sec), - "-i {}".format(audio_file), + "-i \"{}\"".format(audio_file), audio_fpath ]) # run subprocess self.log.debug("Executing: {}".format(cmd)) openpype.api.run_subprocess( - cmd, shell=True, logger=self.log + cmd, logger=self.log ) else: audio_fpath = recycling_file.pop() @@ -218,11 +218,11 @@ class ExtractOtioAudioTracks(pyblish.api.ContextPlugin): # create empty cmd cmd = " ".join([ - self.ffmpeg_path, + '"{}"'.format(self.ffmpeg_path), "-f lavfi", "-i anullsrc=channel_layout=stereo:sample_rate=48000", "-t {}".format(max_duration_sec), - empty_fpath + "\"{}\"".format(empty_fpath) ]) # generate empty with ffmpeg @@ -230,7 +230,7 @@ class ExtractOtioAudioTracks(pyblish.api.ContextPlugin): self.log.debug("Executing: {}".format(cmd)) openpype.api.run_subprocess( - cmd, shell=True, logger=self.log + cmd, logger=self.log ) # return dict with output diff --git a/openpype/plugins/publish/extract_otio_review.py b/openpype/plugins/publish/extract_otio_review.py index 07fe6f2731..2f46bcb375 100644 --- a/openpype/plugins/publish/extract_otio_review.py +++ b/openpype/plugins/publish/extract_otio_review.py @@ -209,7 +209,7 @@ class ExtractOTIOReview(openpype.api.Extractor): "frameStart": start, "frameEnd": end, "stagingDir": self.staging_dir, - "tags": ["review", "ftrackreview", "delete"] + "tags": ["review", "delete"] } collection = clique.Collection( @@ -313,7 +313,7 @@ class ExtractOTIOReview(openpype.api.Extractor): out_frame_start += end_offset # start command list - command = [ffmpeg_path] + command = ['"{}"'.format(ffmpeg_path)] if sequence: input_dir, collection = sequence @@ -326,7 +326,7 @@ class ExtractOTIOReview(openpype.api.Extractor): # form command for rendering gap files command.extend([ "-start_number {}".format(in_frame_start), - "-i {}".format(input_path) + "-i \"{}\"".format(input_path) ]) elif video: @@ -341,7 +341,7 @@ class ExtractOTIOReview(openpype.api.Extractor): command.extend([ "-ss {}".format(sec_start), "-t {}".format(sec_duration), - "-i {}".format(video_path) + "-i \"{}\"".format(video_path) ]) elif gap: @@ -360,11 +360,13 @@ class ExtractOTIOReview(openpype.api.Extractor): # add output attributes command.extend([ "-start_number {}".format(out_frame_start), - output_path + "\"{}\"".format(output_path) ]) # execute self.log.debug("Executing: {}".format(" ".join(command))) - output = openpype.api.run_subprocess(" ".join(command), shell=True) + output = openpype.api.run_subprocess( + " ".join(command), logger=self.log + ) self.log.debug("Output: {}".format(output)) def _generate_used_frames(self, duration, end_offset=None):