aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-01-09 14:46:19 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-01-09 14:46:19 +0100
commit712e86b999ef8ba56afb9c5b8a12699b5a0bbc5d (patch)
tree91e61c1767f4c2c4d3829a597560348f99256477 /youtube_dl
parent74fdba620d5133d8c6515b0d5e7cb9b3e23beb3e (diff)
Fix broken ffmpeg (Closes #623)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/PostProcessor.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/youtube_dl/PostProcessor.py b/youtube_dl/PostProcessor.py
index a04828518..d7c7346d7 100644
--- a/youtube_dl/PostProcessor.py
+++ b/youtube_dl/PostProcessor.py
@@ -86,7 +86,7 @@ class FFmpegExtractAudioPP(PostProcessor):
def get_audio_codec(self, path):
if not self._exes['ffprobe'] and not self._exes['avprobe']: return None
try:
- cmd = [self._exes['avprobe'] or self._exes['ffprobe'], '-show_streams', '--', encodeFilename(path)]
+ cmd = [self._exes['avprobe'] or self._exes['ffprobe'], '-show_streams', encodeFilename(self._ffmpeg_filename_argument(path))]
handle = subprocess.Popen(cmd, stderr=compat_subprocess_get_DEVNULL(), stdout=subprocess.PIPE)
output = handle.communicate()[0]
if handle.wait() != 0:
@@ -110,7 +110,7 @@ class FFmpegExtractAudioPP(PostProcessor):
acodec_opts = ['-acodec', codec]
cmd = ([self._exes['avconv'] or self._exes['ffmpeg'], '-y', '-i', encodeFilename(path), '-vn']
+ acodec_opts + more_opts +
- ['--', encodeFilename(out_path)])
+ [encodeFilename(self._ffmpeg_filename_argument(out_path))])
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout,stderr = p.communicate()
if p.returncode != 0:
@@ -202,3 +202,10 @@ class FFmpegExtractAudioPP(PostProcessor):
information['filepath'] = new_path
return information
+
+ def _ffmpeg_filename_argument(self, fn):
+ # ffmpeg broke --, see https://ffmpeg.org/trac/ffmpeg/ticket/2127 for details
+ if fn.startswith(u'-'):
+ return u'./' + fn
+ return fn
+