mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-27 00:11:24 +00:00
[ffmpeg] Correctly encode paths on Windows
On Python 2.x on Windows, if there are any unicode arguments in the command argument list, the whole list is converted to unicode internally. Therefore, we need to call encodeArgument on every argument. Fixes #4337 and #4668.
This commit is contained in:
parent
c0bdf32a3c
commit
b0e87c3110
1 changed files with 5 additions and 4 deletions
|
@ -80,8 +80,9 @@ def run_ffmpeg_multiple_files(self, input_paths, out_path, opts):
|
|||
|
||||
files_cmd = []
|
||||
for path in input_paths:
|
||||
files_cmd.extend(['-i', encodeFilename(path, True)])
|
||||
cmd = ([self._executable, '-y'] + files_cmd
|
||||
files_cmd.extend([encodeArgument('-i'), encodeFilename(path, True)])
|
||||
cmd = ([encodeFilename(self._executable, True), encodeArgument('-y')] +
|
||||
files_cmd
|
||||
+ [encodeArgument(o) for o in opts] +
|
||||
[encodeFilename(self._ffmpeg_filename_argument(out_path), True)])
|
||||
|
||||
|
@ -122,8 +123,8 @@ def get_audio_codec(self, path):
|
|||
raise PostProcessingError('ffprobe or avprobe not found. Please install one.')
|
||||
try:
|
||||
cmd = [
|
||||
self._probe_executable,
|
||||
'-show_streams',
|
||||
encodeFilename(self._probe_executable, True),
|
||||
encodeArgument('-show_streams'),
|
||||
encodeFilename(self._ffmpeg_filename_argument(path), True)]
|
||||
handle = subprocess.Popen(cmd, stderr=compat_subprocess_get_DEVNULL(), stdout=subprocess.PIPE)
|
||||
output = handle.communicate()[0]
|
||||
|
|
Loading…
Reference in a new issue