adding reformating to oiiotool process

- removing it from wrong ffmpeg process
This commit is contained in:
Jakub Jezek 2023-11-24 22:04:11 +01:00
parent 069977b327
commit cd8451e811
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -217,11 +217,17 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
def _create_thumbnail_oiio(self, src_path, dst_path): def _create_thumbnail_oiio(self, src_path, dst_path):
self.log.debug("Extracting thumbnail with OIIO: {}".format(dst_path)) self.log.debug("Extracting thumbnail with OIIO: {}".format(dst_path))
resolution_arg = self._get_resolution_arg("oiiotool", src_path)
oiio_cmd = get_oiio_tool_args( oiio_cmd = get_oiio_tool_args(
"oiiotool", "oiiotool", path_to_subprocess_arg(src_path)
"-a", src_path,
"-o", dst_path
) )
if resolution_arg:
oiio_cmd.extend(resolution_arg)
oiio_cmd.extend([
"-o", path_to_subprocess_arg(dst_path)
])
self.log.debug("running: {}".format(" ".join(oiio_cmd))) self.log.debug("running: {}".format(" ".join(oiio_cmd)))
try: try:
run_subprocess(oiio_cmd, logger=self.log) run_subprocess(oiio_cmd, logger=self.log)
@ -235,7 +241,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
def _create_thumbnail_ffmpeg(self, src_path, dst_path): def _create_thumbnail_ffmpeg(self, src_path, dst_path):
self.log.debug("Extracting thumbnail with FFMPEG: {}".format(dst_path)) self.log.debug("Extracting thumbnail with FFMPEG: {}".format(dst_path))
resolution_arg = self._get_resolution_arg("ffmpeg") resolution_arg = self._get_resolution_arg("ffmpeg", src_path)
ffmpeg_path_args = get_ffmpeg_tool_args("ffmpeg") ffmpeg_path_args = get_ffmpeg_tool_args("ffmpeg")
ffmpeg_args = self.ffmpeg_args or {} ffmpeg_args = self.ffmpeg_args or {}
@ -297,14 +303,6 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
"-vframes", "1" "-vframes", "1"
] ]
# get resolution arg
resolution_arg = self._get_resolution_arg(
"ffmpeg",
video_file_path,
)
if resolution_arg:
cmd_args.extend(resolution_arg)
# add output file path # add output file path
cmd_args.append(output_thumb_file_path) cmd_args.append(output_thumb_file_path)