summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <[email protected]>2015-02-06 22:05:11 +0100
committerJaime Marquínez Ferrándiz <[email protected]>2015-02-06 22:05:11 +0100
commit467d3c9a0c364fe4e24c6efd1d20317a80eee547 (patch)
tree7f88922feb4e7d3b7c6379baa7fe176810bed5ab
parentad5747bad146c76f545870911d5f2fb586c0f7b1 (diff)
downloadyoutube-dl-467d3c9a0c364fe4e24c6efd1d20317a80eee547.tar.gz
youtube-dl-467d3c9a0c364fe4e24c6efd1d20317a80eee547.zip
[ffmpeg] --extrac-audio: Use the same options for avconv and ffmpeg
They have been available in ffmpeg since version 0.9, and we require 1.0 or higher.
-rw-r--r--youtube_dl/postprocessor/ffmpeg.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py
index 4a4422c5a..01d25f760 100644
--- a/youtube_dl/postprocessor/ffmpeg.py
+++ b/youtube_dl/postprocessor/ffmpeg.py
@@ -166,14 +166,13 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
if filecodec is None:
raise PostProcessingError('WARNING: unable to obtain file audio codec with ffprobe')
- uses_avconv = self._uses_avconv()
more_opts = []
if self._preferredcodec == 'best' or self._preferredcodec == filecodec or (self._preferredcodec == 'm4a' and filecodec == 'aac'):
if filecodec == 'aac' and self._preferredcodec in ['m4a', 'best']:
# Lossless, but in another container
acodec = 'copy'
extension = 'm4a'
- more_opts = ['-bsf:a' if uses_avconv else '-absf', 'aac_adtstoasc']
+ more_opts = ['-bsf:a', 'aac_adtstoasc']
elif filecodec in ['aac', 'mp3', 'vorbis', 'opus']:
# Lossless if possible
acodec = 'copy'
@@ -189,9 +188,9 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
more_opts = []
if self._preferredquality is not None:
if int(self._preferredquality) < 10:
- more_opts += ['-q:a' if uses_avconv else '-aq', self._preferredquality]
+ more_opts += ['-q:a', self._preferredquality]
else:
- more_opts += ['-b:a' if uses_avconv else '-ab', self._preferredquality + 'k']
+ more_opts += ['-b:a', self._preferredquality + 'k']
else:
# We convert the audio (lossy)
acodec = {'mp3': 'libmp3lame', 'aac': 'aac', 'm4a': 'aac', 'opus': 'opus', 'vorbis': 'libvorbis', 'wav': None}[self._preferredcodec]
@@ -200,13 +199,13 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
if self._preferredquality is not None:
# The opus codec doesn't support the -aq option
if int(self._preferredquality) < 10 and extension != 'opus':
- more_opts += ['-q:a' if uses_avconv else '-aq', self._preferredquality]
+ more_opts += ['-q:a', self._preferredquality]
else:
- more_opts += ['-b:a' if uses_avconv else '-ab', self._preferredquality + 'k']
+ more_opts += ['-b:a', self._preferredquality + 'k']
if self._preferredcodec == 'aac':
more_opts += ['-f', 'adts']
if self._preferredcodec == 'm4a':
- more_opts += ['-bsf:a' if uses_avconv else '-absf', 'aac_adtstoasc']
+ more_opts += ['-bsf:a', 'aac_adtstoasc']
if self._preferredcodec == 'vorbis':
extension = 'ogg'
if self._preferredcodec == 'wav':