aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-11 02:00:31 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-11 02:00:31 +0600
commit13763ce599c8fbba43e57d2d79a9b007cfbd4ced (patch)
tree47e39e4a2cdd7d27a501cc805cb4b5a237e4d898 /youtube_dl
parent7fcb605b82796e79a5f559624808ca9404df1154 (diff)
[postprocessor/ffmpeg] Add `can_merge` method
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/postprocessor/ffmpeg.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py
index 211faf69a..cc65b34e7 100644
--- a/youtube_dl/postprocessor/ffmpeg.py
+++ b/youtube_dl/postprocessor/ffmpeg.py
@@ -36,9 +36,7 @@ class FFmpegPostProcessor(PostProcessor):
def check_version(self):
if not self.available:
raise FFmpegPostProcessorError('ffmpeg or avconv not found. Please install one.')
- self.check_outdated()
- def check_outdated(self):
required_version = '10-0' if self.basename == 'avconv' else '1.0'
if is_outdated_version(
self._versions[self.basename], required_version):
@@ -46,8 +44,6 @@ class FFmpegPostProcessor(PostProcessor):
self.basename, self.basename, required_version)
if self._downloader:
self._downloader.report_warning(warning)
- return True
- return False
@staticmethod
def get_versions(downloader=None):
@@ -595,6 +591,23 @@ class FFmpegMergerPP(FFmpegPostProcessor):
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
return info['__files_to_merge'], info
+ def can_merge(self):
+ # TODO: figure out merge-capable ffmpeg version
+ if self.basename != 'avconv':
+ return True
+
+ required_version = '10-0'
+ if is_outdated_version(
+ self._versions[self.basename], required_version):
+ warning = ('Your copy of %s is outdated and unable to properly mux separate video and audio files, '
+ 'youtube-dl will download single file media. '
+ 'Update %s to version %s or newer to fix this.') % (
+ self.basename, self.basename, required_version)
+ if self._downloader:
+ self._downloader.report_warning(warning)
+ return False
+ return True
+
class FFmpegFixupStretchedPP(FFmpegPostProcessor):
def run(self, info):