diff options
Diffstat (limited to 'youtube_dl/postprocessor')
-rw-r--r-- | youtube_dl/postprocessor/common.py | 6 | ||||
-rw-r--r-- | youtube_dl/postprocessor/ffmpeg.py | 11 |
2 files changed, 9 insertions, 8 deletions
diff --git a/youtube_dl/postprocessor/common.py b/youtube_dl/postprocessor/common.py index d944d9367..c44501b59 100644 --- a/youtube_dl/postprocessor/common.py +++ b/youtube_dl/postprocessor/common.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import os +import shlex from ..utils import ( PostProcessingError, @@ -23,12 +24,13 @@ class PostProcessor(object): PostProcessor objects follow a "mutual registration" process similar to InfoExtractor objects. And it can receive parameters from CLI trough - --pp-params. + --postprocessor-args. """ _downloader = None - def __init__(self, downloader=None): + def __init__(self, downloader=None, extra_cmd_args=None): + self._extra_cmd_args = shlex.split(extra_cmd_args or '') self._downloader = downloader def set_downloader(self, downloader): diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index a696b12b4..891c72769 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -29,8 +29,8 @@ class FFmpegPostProcessorError(PostProcessingError): class FFmpegPostProcessor(PostProcessor): - def __init__(self, downloader=None): - PostProcessor.__init__(self, downloader) + def __init__(self, downloader=None, extra_cmd_args=None): + PostProcessor.__init__(self, downloader, extra_cmd_args) self._determine_executables() def check_version(self): @@ -287,16 +287,15 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor): class FFmpegVideoConvertorPP(FFmpegPostProcessor): - def __init__(self, downloader=None, preferedformat=None, extra_params=[]): - super(FFmpegVideoConvertorPP, self).__init__(downloader) + def __init__(self, downloader=None, preferedformat=None, extra_cmd_args=None): + super(FFmpegVideoConvertorPP, self).__init__(downloader, extra_cmd_args) self._preferedformat = preferedformat - self._extra_params = extra_params def run(self, information): path = information['filepath'] prefix, sep, ext = path.rpartition('.') ext = self._preferedformat - options = self._extra_params + options = self._extra_cmd_args if self._preferedformat == 'xvid': ext = 'avi' options.extend(['-c:v', 'libxvid', '-vtag', 'XVID']) |