diff options
author | Tom-Oliver Heidel <blackjack4494@web.de> | 2020-09-16 10:30:38 +0200 |
---|---|---|
committer | Tom-Oliver Heidel <blackjack4494@web.de> | 2020-09-16 10:30:38 +0200 |
commit | cd93279de828c0e73a7607f4da9750d572010f59 (patch) | |
tree | 7675a4a77601579afdb6de0f126a67a502727dd3 /youtube_dlc/postprocessor/ffmpeg.py | |
parent | 89233ccbfb508dee433a14d6b6357baac2bcbbae (diff) | |
parent | efe87a10ae57fa74d7aa038109079a17a3c4fad2 (diff) | |
download | hypervideo-pre-cd93279de828c0e73a7607f4da9750d572010f59.tar.lz hypervideo-pre-cd93279de828c0e73a7607f4da9750d572010f59.tar.xz hypervideo-pre-cd93279de828c0e73a7607f4da9750d572010f59.zip |
Merge branch 'ext/remuxe-video' of https://github.com/Zocker1999NET/youtube-dl into Zocker1999NET-ext/remuxe-video
Diffstat (limited to 'youtube_dlc/postprocessor/ffmpeg.py')
-rw-r--r-- | youtube_dlc/postprocessor/ffmpeg.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/youtube_dlc/postprocessor/ffmpeg.py b/youtube_dlc/postprocessor/ffmpeg.py index 5d66a69a6..5e85f4eeb 100644 --- a/youtube_dlc/postprocessor/ffmpeg.py +++ b/youtube_dlc/postprocessor/ffmpeg.py @@ -349,6 +349,27 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor): return [path], information +class FFmpegVideoRemuxerPP(FFmpegPostProcessor): + def __init__(self, downloader=None, preferedformat=None): + super(FFmpegVideoRemuxerPP, self).__init__(downloader) + self._preferedformat = preferedformat + + def run(self, information): + path = information['filepath'] + if information['ext'] == self._preferedformat: + self._downloader.to_screen('[ffmpeg] Not remuxing video file %s - already is in target format %s' % (path, self._preferedformat)) + return [], information + options = ['-c', 'copy'] + prefix, sep, ext = path.rpartition('.') + outpath = prefix + sep + self._preferedformat + self._downloader.to_screen('[' + 'ffmpeg' + '] Remuxing video from %s to %s, Destination: ' % (information['ext'], self._preferedformat) + outpath) + self.run_ffmpeg(path, outpath, options) + information['filepath'] = outpath + information['format'] = self._preferedformat + information['ext'] = self._preferedformat + return [path], information + + class FFmpegVideoConvertorPP(FFmpegPostProcessor): def __init__(self, downloader=None, preferedformat=None): super(FFmpegVideoConvertorPP, self).__init__(downloader) |