Rapsys Git
/
youtubedl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start preparing new release.
[youtubedl]
/
youtube_dl
/
postprocessor
/
ffmpeg.py
diff --git
a/youtube_dl/postprocessor/ffmpeg.py
b/youtube_dl/postprocessor/ffmpeg.py
index 1881f4849e23c749d51da2e45d655ed4e6a68314..7c162d92abb43f9cf522eeeb52bb9675a06a24f7 100644
(file)
--- a/
youtube_dl/postprocessor/ffmpeg.py
+++ b/
youtube_dl/postprocessor/ffmpeg.py
@@
-26,15
+26,25
@@
from ..utils import (
EXT_TO_OUT_FORMATS = {
EXT_TO_OUT_FORMATS = {
- "aac": "adts",
- "m4a": "ipod",
- "mka": "matroska",
- "mkv": "matroska",
- "mpg": "mpeg",
- "ogv": "ogg",
- "ts": "mpegts",
- "wma": "asf",
- "wmv": "asf",
+ 'aac': 'adts',
+ 'flac': 'flac',
+ 'm4a': 'ipod',
+ 'mka': 'matroska',
+ 'mkv': 'matroska',
+ 'mpg': 'mpeg',
+ 'ogv': 'ogg',
+ 'ts': 'mpegts',
+ 'wma': 'asf',
+ 'wmv': 'asf',
+}
+ACODECS = {
+ 'mp3': 'libmp3lame',
+ 'aac': 'aac',
+ 'flac': 'flac',
+ 'm4a': 'aac',
+ 'opus': 'opus',
+ 'vorbis': 'libvorbis',
+ 'wav': None,
}
}
@@
-237,7
+247,7
@@
class FFmpegExtractAudioPP(FFmpegPostProcessor):
acodec = 'copy'
extension = 'm4a'
more_opts = ['-bsf:a', 'aac_adtstoasc']
acodec = 'copy'
extension = 'm4a'
more_opts = ['-bsf:a', 'aac_adtstoasc']
- elif filecodec in ['aac', 'mp3', 'vorbis', 'opus']:
+ elif filecodec in ['aac', '
flac', '
mp3', 'vorbis', 'opus']:
# Lossless if possible
acodec = 'copy'
extension = filecodec
# Lossless if possible
acodec = 'copy'
extension = filecodec
@@
-256,8
+266,8
@@
class FFmpegExtractAudioPP(FFmpegPostProcessor):
else:
more_opts += ['-b:a', self._preferredquality + 'k']
else:
else:
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]
+ # We convert the audio (lossy
if codec is lossy
)
+ acodec =
ACODECS
[self._preferredcodec]
extension = self._preferredcodec
more_opts = []
if self._preferredquality is not None:
extension = self._preferredcodec
more_opts = []
if self._preferredquality is not None:
@@
-536,8
+546,7
@@
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
ext = sub['ext']
if ext == new_ext:
self._downloader.to_screen(
ext = sub['ext']
if ext == new_ext:
self._downloader.to_screen(
- '[ffmpeg] Subtitle file for %s is already in the requested'
- 'format' % new_ext)
+ '[ffmpeg] Subtitle file for %s is already in the requested format' % new_ext)
continue
old_file = subtitles_filename(filename, lang, ext)
sub_filenames.append(old_file)
continue
old_file = subtitles_filename(filename, lang, ext)
sub_filenames.append(old_file)