use get_path_to_ffmpeg which checks if any of filled ffmpeg paths in FFMPEG_PATH exists

This commit is contained in:
iLLiCiTiT 2020-02-11 14:01:56 +01:00
parent c71b8dbf2c
commit 62b3f852f1
9 changed files with 28 additions and 13 deletions

View file

@ -3,6 +3,7 @@ import os
import pyblish.api
import clique
import pype.api
import pype.lib
class ExtractJpegEXR(pyblish.api.InstancePlugin):
@ -67,7 +68,7 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin):
jpeg_items = []
jpeg_items.append(
os.path.join(os.environ.get("FFMPEG_PATH"), "ffmpeg"))
os.path.join(pype.lib.get_path_to_ffmpeg(), "ffmpeg"))
# override file if already exists
jpeg_items.append("-y")
# use same input args like with mov

View file

@ -313,9 +313,8 @@ class ExtractReview(pyblish.api.InstancePlugin):
mov_args = [
os.path.join(
os.environ.get(
"FFMPEG_PATH",
""), "ffmpeg"),
pype.lib.get_path_to_ffmpeg(), "ffmpeg"
),
" ".join(input_args),
" ".join(output_args)
]

View file

@ -1,5 +1,6 @@
import os
import pype.api
import pype.lib
import pyblish
@ -21,7 +22,7 @@ class ExtractReviewSlate(pype.api.Extractor):
suffix = "_slate"
slate_path = inst_data.get("slateFrame")
ffmpeg_path = os.path.join(os.environ.get("FFMPEG_PATH", ""), "ffmpeg")
ffmpeg_path = os.path.join(pype.lib.get_path_to_ffmpeg(), "ffmpeg")
to_width = 1920
to_height = 1080

View file

@ -1,6 +1,7 @@
import pyblish.api
import os
import subprocess
import pype.lib
try:
import os.errno as errno
except ImportError:
@ -28,9 +29,10 @@ class ValidateFfmpegInstallef(pyblish.api.Validator):
def process(self, instance):
self.log.info("ffmpeg path: `{}`".format(
os.environ.get("FFMPEG_PATH", "")))
pype.lib.get_path_to_ffmpeg()
))
if self.is_tool(
os.path.join(
os.environ.get("FFMPEG_PATH", ""), "ffmpeg")) is False:
pype.lib.get_path_to_ffmpeg(), "ffmpeg")) is False:
self.log.error("ffmpeg not found in PATH")
raise RuntimeError('ffmpeg not installed.')

View file

@ -4,6 +4,7 @@ import tempfile
import pyblish.api
import clique
import pype.api
import pype.lib
class ExtractReviewSP(pyblish.api.InstancePlugin):
@ -148,7 +149,7 @@ class ExtractReviewSP(pyblish.api.InstancePlugin):
# output filename
output_args.append(full_output_path)
ffmpeg_path = os.getenv("FFMPEG_PATH", "")
ffmpeg_path = pype.lib.get_path_to_ffmpeg()
if ffmpeg_path:
ffmpeg_path += "/ffmpeg"
else:

View file

@ -3,6 +3,7 @@ import tempfile
import subprocess
import pyblish.api
import pype.api
import pype.lib
class ExtractThumbnailSP(pyblish.api.InstancePlugin):
@ -73,7 +74,7 @@ class ExtractThumbnailSP(pyblish.api.InstancePlugin):
config_data.get("__default__", {})
)
ffmpeg_path = os.getenv("FFMPEG_PATH", "")
ffmpeg_path = pype.lib.get_path_to_ffmpeg()
if ffmpeg_path:
ffmpeg_path += "/ffmpeg"
else: