mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-13 19:19:41 +08:00
Add options to ffmpeg post processing
https://trac.ffmpeg.org/wiki/Encode/VP8 ffmpeg guide stats: "Important: If neither -b:v nor -crf are set, the encoder will use a low default bitrate and your result will probably look very bad. Always supply one of these options—ideally both."
This commit is contained in:
parent
480b7c32a9
commit
c16ec093fc
@ -235,9 +235,10 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
|
||||
|
||||
|
||||
class FFmpegVideoConvertor(FFmpegPostProcessor):
|
||||
def __init__(self, downloader=None,preferedformat=None):
|
||||
def __init__(self, downloader=None,preferedformat=None,opts=[]):
|
||||
super(FFmpegVideoConvertor, self).__init__(downloader)
|
||||
self._preferedformat=preferedformat
|
||||
self._opts = opts
|
||||
|
||||
def run(self, information):
|
||||
path = information['filepath']
|
||||
@ -247,7 +248,7 @@ class FFmpegVideoConvertor(FFmpegPostProcessor):
|
||||
self._downloader.to_screen(u'[ffmpeg] Not converting video file %s - already is in target format %s' % (path, self._preferedformat))
|
||||
return True,information
|
||||
self._downloader.to_screen(u'['+'ffmpeg'+'] Converting video from %s to %s, Destination: ' % (information['ext'], self._preferedformat) +outpath)
|
||||
self.run_ffmpeg(path, outpath, [])
|
||||
self.run_ffmpeg(path, outpath, self._opts)
|
||||
information['filepath'] = outpath
|
||||
information['format'] = self._preferedformat
|
||||
information['ext'] = self._preferedformat
|
||||
|
Loading…
x
Reference in New Issue
Block a user