mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
path to ffmpeg tools has always quotes to make sure spaces won't cause unnecessary behavior
This commit is contained in:
parent
e8a817a89b
commit
7e4807e7ee
12 changed files with 18 additions and 17 deletions
|
|
@ -1397,7 +1397,7 @@ def ffprobe_streams(path_to_file):
|
||||||
"Getting information about input \"{}\".".format(path_to_file)
|
"Getting information about input \"{}\".".format(path_to_file)
|
||||||
)
|
)
|
||||||
args = [
|
args = [
|
||||||
get_ffmpeg_tool_path("ffprobe"),
|
"\"{}\"".format(get_ffmpeg_tool_path("ffprobe")),
|
||||||
"-v quiet",
|
"-v quiet",
|
||||||
"-print_format json",
|
"-print_format json",
|
||||||
"-show_format",
|
"-show_format",
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin):
|
||||||
ffmpeg_args = self.ffmpeg_args or {}
|
ffmpeg_args = self.ffmpeg_args or {}
|
||||||
|
|
||||||
jpeg_items = []
|
jpeg_items = []
|
||||||
jpeg_items.append(ffmpeg_path)
|
jpeg_items.append("\"{}\"".format(ffmpeg_path))
|
||||||
# override file if already exists
|
# override file if already exists
|
||||||
jpeg_items.append("-y")
|
jpeg_items.append("-y")
|
||||||
# use same input args like with mov
|
# use same input args like with mov
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ class ExtractReview(pyblish.api.InstancePlugin):
|
||||||
audio_filters.append(arg)
|
audio_filters.append(arg)
|
||||||
|
|
||||||
all_args = []
|
all_args = []
|
||||||
all_args.append(self.ffmpeg_path)
|
all_args.append("\"{}\"".format(self.ffmpeg_path))
|
||||||
all_args.extend(input_args)
|
all_args.extend(input_args)
|
||||||
if video_filters:
|
if video_filters:
|
||||||
all_args.append("-filter:v {}".format(",".join(video_filters)))
|
all_args.append("-filter:v {}".format(",".join(video_filters)))
|
||||||
|
|
@ -1526,7 +1526,7 @@ class ExtractReview(pyblish.api.InstancePlugin):
|
||||||
os.mkdir(stg_dir)
|
os.mkdir(stg_dir)
|
||||||
|
|
||||||
mov_args = [
|
mov_args = [
|
||||||
ffmpeg_path,
|
"\"{}\"".format(ffmpeg_path),
|
||||||
" ".join(input_args),
|
" ".join(input_args),
|
||||||
" ".join(output_args)
|
" ".join(output_args)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ class ExtractReviewSlate(pype.api.Extractor):
|
||||||
_remove_at_end.append(slate_v_path)
|
_remove_at_end.append(slate_v_path)
|
||||||
|
|
||||||
slate_args = [
|
slate_args = [
|
||||||
ffmpeg_path,
|
"\"{}\"".format(ffmpeg_path),
|
||||||
" ".join(input_args),
|
" ".join(input_args),
|
||||||
" ".join(output_args)
|
" ".join(output_args)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,6 @@ class ValidateFFmpegInstalled(pyblish.api.ContextPlugin):
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg")
|
ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg")
|
||||||
self.log.info("ffmpeg path: `{}`".format(ffmpeg_path))
|
self.log.info("ffmpeg path: `{}`".format(ffmpeg_path))
|
||||||
if self.is_tool(ffmpeg_path) is False:
|
if self.is_tool("\"{}\"".format(ffmpeg_path)) is False:
|
||||||
self.log.error("ffmpeg not found in PATH")
|
self.log.error("ffmpeg not found in PATH")
|
||||||
raise RuntimeError('ffmpeg not installed.')
|
raise RuntimeError('ffmpeg not installed.')
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
||||||
thumbnail_path = os.path.join(path, "thumbnail.png")
|
thumbnail_path = os.path.join(path, "thumbnail.png")
|
||||||
ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg")
|
ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg")
|
||||||
args = [
|
args = [
|
||||||
ffmpeg_path, "-y",
|
"\"{}\"".format(ffmpeg_path), "-y",
|
||||||
"-i", os.path.join(path, list(collections[0])[0]),
|
"-i", os.path.join(path, list(collections[0])[0]),
|
||||||
"-vf", "scale=300:-1",
|
"-vf", "scale=300:-1",
|
||||||
"-vframes", "1",
|
"-vframes", "1",
|
||||||
|
|
|
||||||
|
|
@ -130,8 +130,8 @@ class ExtractReviewCutUp(pype.api.Extractor):
|
||||||
|
|
||||||
# check if audio stream is in input video file
|
# check if audio stream is in input video file
|
||||||
ffprob_cmd = (
|
ffprob_cmd = (
|
||||||
"{ffprobe_path} -i \"{full_input_path}\" -show_streams "
|
"\"{ffprobe_path}\" -i \"{full_input_path}\" -show_streams"
|
||||||
"-select_streams a -loglevel error"
|
" -select_streams a -loglevel error"
|
||||||
).format(**locals())
|
).format(**locals())
|
||||||
|
|
||||||
self.log.debug("ffprob_cmd: {}".format(ffprob_cmd))
|
self.log.debug("ffprob_cmd: {}".format(ffprob_cmd))
|
||||||
|
|
@ -171,7 +171,8 @@ class ExtractReviewCutUp(pype.api.Extractor):
|
||||||
# try to get video native resolution data
|
# try to get video native resolution data
|
||||||
try:
|
try:
|
||||||
resolution_output = pype.api.subprocess((
|
resolution_output = pype.api.subprocess((
|
||||||
"{ffprobe_path} -i \"{full_input_path}\" -v error "
|
"\"{ffprobe_path}\" -i \"{full_input_path}\""
|
||||||
|
" -v error "
|
||||||
"-select_streams v:0 -show_entries "
|
"-select_streams v:0 -show_entries "
|
||||||
"stream=width,height -of csv=s=x:p=0"
|
"stream=width,height -of csv=s=x:p=0"
|
||||||
).format(**locals()))
|
).format(**locals()))
|
||||||
|
|
@ -274,7 +275,7 @@ class ExtractReviewCutUp(pype.api.Extractor):
|
||||||
output_args.append("-y \"{}\"".format(full_output_path))
|
output_args.append("-y \"{}\"".format(full_output_path))
|
||||||
|
|
||||||
mov_args = [
|
mov_args = [
|
||||||
ffmpeg_path,
|
"\"{}\"".format(ffmpeg_path),
|
||||||
" ".join(input_args),
|
" ".join(input_args),
|
||||||
" ".join(output_args)
|
" ".join(output_args)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class ExtractReview(pype.api.Extractor):
|
||||||
# Generate thumbnail.
|
# Generate thumbnail.
|
||||||
thumbnail_path = os.path.join(staging_dir, "thumbnail.jpg")
|
thumbnail_path = os.path.join(staging_dir, "thumbnail.jpg")
|
||||||
args = [
|
args = [
|
||||||
ffmpeg_path, "-y",
|
"\"{}\"".format(ffmpeg_path), "-y",
|
||||||
"-i", output_image_path,
|
"-i", output_image_path,
|
||||||
"-vf", "scale=300:-1",
|
"-vf", "scale=300:-1",
|
||||||
"-vframes", "1",
|
"-vframes", "1",
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class ExtractShotData(pype.api.Extractor):
|
||||||
start += 0.5
|
start += 0.5
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
ffmpeg_path,
|
"\"{}\"".format(ffmpeg_path),
|
||||||
"-ss", str(start / fps),
|
"-ss", str(start / fps),
|
||||||
"-i", f"\"{video_file_path}\"",
|
"-i", f"\"{video_file_path}\"",
|
||||||
"-t", str(dur / fps)
|
"-t", str(dur / fps)
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ class ExtractThumbnailSP(pyblish.api.InstancePlugin):
|
||||||
ffmpeg_args = self.ffmpeg_args or {}
|
ffmpeg_args = self.ffmpeg_args or {}
|
||||||
|
|
||||||
jpeg_items = []
|
jpeg_items = []
|
||||||
jpeg_items.append(ffmpeg_path)
|
jpeg_items.append("\"{}\"".format(ffmpeg_path))
|
||||||
# override file if already exists
|
# override file if already exists
|
||||||
jpeg_items.append("-y")
|
jpeg_items.append("-y")
|
||||||
# add input filters from peresets
|
# add input filters from peresets
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ ffprobe_path = pype.lib.get_ffmpeg_tool_path("ffprobe")
|
||||||
|
|
||||||
|
|
||||||
FFMPEG = (
|
FFMPEG = (
|
||||||
'{} -i "%(input)s" %(filters)s %(args)s%(output)s'
|
'\"{}\" -i "%(input)s" %(filters)s %(args)s%(output)s'
|
||||||
).format(ffmpeg_path)
|
).format(ffmpeg_path)
|
||||||
|
|
||||||
FFPROBE = (
|
FFPROBE = (
|
||||||
'{} -v quiet -print_format json -show_format -show_streams "%(source)s"'
|
'\"{}\" -v quiet -print_format json -show_format -show_streams "%(source)s"'
|
||||||
).format(ffprobe_path)
|
).format(ffprobe_path)
|
||||||
|
|
||||||
DRAWTEXT = (
|
DRAWTEXT = (
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ class DropDataFrame(QtWidgets.QFrame):
|
||||||
def load_data_with_probe(self, filepath):
|
def load_data_with_probe(self, filepath):
|
||||||
ffprobe_path = pype.lib.get_ffmpeg_tool_path("ffprobe")
|
ffprobe_path = pype.lib.get_ffmpeg_tool_path("ffprobe")
|
||||||
args = [
|
args = [
|
||||||
ffprobe_path,
|
"\"{}\"".format(ffprobe_path),
|
||||||
'-v', 'quiet',
|
'-v', 'quiet',
|
||||||
'-print_format json',
|
'-print_format json',
|
||||||
'-show_format',
|
'-show_format',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue