[youtube] Fixup DASH m4a headers

This fixes #2288, #2506, #2607, #3681, #4741, #4767.
This commit is contained in:
Philipp Hagemeister 2015-01-23 18:39:12 +01:00
parent d229ee70da
commit 62cd676c74
4 changed files with 47 additions and 9 deletions

View file

@ -564,7 +564,7 @@ class FFmpegFixupStretchedPP(FFmpegPostProcessor):
def run(self, info):
stretched_ratio = info.get('stretched_ratio')
if stretched_ratio is None or stretched_ratio == 1:
return
return True, info
filename = info['filepath']
temp_filename = prepend_extension(filename, 'temp')
@ -577,3 +577,21 @@ class FFmpegFixupStretchedPP(FFmpegPostProcessor):
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
return True, info
class FFmpegFixupM4aPP(FFmpegPostProcessor):
def run(self, info):
if info.get('container') != 'm4a_dash':
return True, info
filename = info['filepath']
temp_filename = prepend_extension(filename, 'temp')
options = ['-c', 'copy', '-f', 'mp4']
self._downloader.to_screen('[ffmpeg] Correcting container in "%s"' % filename)
self.run_ffmpeg(filename, temp_filename, options)
os.remove(encodeFilename(filename))
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
return True, info