mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-08 05:02:29 +00:00
@@ -20,9 +20,9 @@ from ..utils import (
|
||||
is_outdated_version,
|
||||
ISO639Utils,
|
||||
orderedSet,
|
||||
Popen,
|
||||
PostProcessingError,
|
||||
prepend_extension,
|
||||
process_communicate_or_kill,
|
||||
replace_extension,
|
||||
shell_quote,
|
||||
traverse_obj,
|
||||
@@ -178,10 +178,8 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
encodeArgument('-i')]
|
||||
cmd.append(encodeFilename(self._ffmpeg_filename_argument(path), True))
|
||||
self.write_debug('%s command line: %s' % (self.basename, shell_quote(cmd)))
|
||||
handle = subprocess.Popen(
|
||||
cmd, stderr=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
stdout_data, stderr_data = process_communicate_or_kill(handle)
|
||||
handle = Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout_data, stderr_data = handle.communicate_or_kill()
|
||||
expected_ret = 0 if self.probe_available else 1
|
||||
if handle.wait() != expected_ret:
|
||||
return None
|
||||
@@ -223,7 +221,7 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
cmd += opts
|
||||
cmd.append(encodeFilename(self._ffmpeg_filename_argument(path), True))
|
||||
self.write_debug('ffprobe command line: %s' % shell_quote(cmd))
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
p = Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
return json.loads(stdout.decode('utf-8', 'replace'))
|
||||
|
||||
@@ -284,8 +282,8 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
for i, (path, opts) in enumerate(path_opts) if path)
|
||||
|
||||
self.write_debug('ffmpeg command line: %s' % shell_quote(cmd))
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
stdout, stderr = process_communicate_or_kill(p)
|
||||
p = Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate_or_kill()
|
||||
if p.returncode not in variadic(expected_retcodes):
|
||||
stderr = stderr.decode('utf-8', 'replace').strip()
|
||||
self.write_debug(stderr)
|
||||
|
Reference in New Issue
Block a user