diff options
author | pulpe <Pulpan3@gmail.com> | 2014-02-22 13:55:51 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-03-26 15:22:51 +0100 |
commit | 0c14e2fbe3c5cba16af27525aa6715819226e6d8 (patch) | |
tree | 15a314fddb62e975c73a3f82991324508dbc896b /youtube_dl/postprocessor/ffmpeg.py | |
parent | 98acdc895bb6795efa1b5890a7af1b6e662051bd (diff) |
add post processor
Diffstat (limited to 'youtube_dl/postprocessor/ffmpeg.py')
-rw-r--r-- | youtube_dl/postprocessor/ffmpeg.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index c22f2cdc6..26a70491a 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -483,3 +483,17 @@ class FFmpegMergerPP(FFmpegPostProcessor): self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args) return True, info + +class FFmpegMediaFixPP(FFmpegPostProcessor): + def run(self, info): + filename = info['filepath'] + temp_filename = prepend_extension(filename, 'temp') + + options = ['-vcodec', 'copy', '-acodec', 'copy'] + self._downloader.to_screen(u'[ffmpeg] Fixing media file "%s"' % filename) + self.run_ffmpeg(filename, temp_filename, options) + + os.remove(encodeFilename(filename)) + os.rename(encodeFilename(temp_filename), encodeFilename(filename)) + + return True, info |