add post processor

This commit is contained in:
pulpe 2014-02-22 13:55:51 +01:00 committed by Jaime Marquínez Ferrándiz
parent 98acdc895b
commit 0c14e2fbe3
4 changed files with 84 additions and 0 deletions

View file

@ -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