Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote filenames to handle paths with spaces in commands created with .compile() #719

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ffmpeg/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from ._utils import basestring, convert_kwargs_to_cmd_line_args
from builtins import str
from functools import reduce
from shlex import quote
import copy
import operator
import subprocess
Expand Down Expand Up @@ -44,7 +45,7 @@ def _get_input_args(input_node):
if video_size:
args += ['-video_size', '{}x{}'.format(video_size[0], video_size[1])]
args += convert_kwargs_to_cmd_line_args(kwargs)
args += ['-i', filename]
args += ['-i', quote(filename)]
else:
raise ValueError('Unsupported input node: {}'.format(input_node))
return args
Expand Down Expand Up @@ -144,7 +145,7 @@ def _get_output_args(node, stream_name_map):
video_size = '{}x{}'.format(video_size[0], video_size[1])
args += ['-video_size', video_size]
args += convert_kwargs_to_cmd_line_args(kwargs)
args += [filename]
args += [quote(filename)]
return args


Expand Down