Skip to content

Commit

Permalink
ffprobe run as list of args instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Oct 25, 2022
1 parent 72287eb commit 438922c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions openpype/scripts/otio_burnin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
'"{}"%(input_args)s -i "%(input)s" %(filters)s %(args)s%(output)s'
).format(ffmpeg_path)

FFPROBE = (
'"{}" -v quiet -print_format json -show_format -show_streams "%(source)s"'
).format(ffprobe_path)

DRAWTEXT = (
"drawtext=fontfile='%(font)s':text=\\'%(text)s\\':"
"x=%(x)s:y=%(y)s:fontcolor=%(color)s@%(opacity).1f:fontsize=%(size)d"
Expand All @@ -48,8 +44,15 @@ def _get_ffprobe_data(source):
:param str source: source media file
:rtype: [{}, ...]
"""
command = FFPROBE % {'source': source}
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
command = [
ffprobe_path,
"-v", "quiet",
"-print_format", "json",
"-show_format",
"-show_streams",
source
]
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out = proc.communicate()[0]
if proc.returncode != 0:
raise RuntimeError("Failed to run: %s" % command)
Expand Down

0 comments on commit 438922c

Please sign in to comment.