|
@ -391,10 +391,6 @@ class FFmpegMetadataPP(FFmpegPostProcessor): |
|
|
for (name, value) in metadata.items(): |
|
|
for (name, value) in metadata.items(): |
|
|
options.extend(['-metadata', '%s=%s' % (name, value)]) |
|
|
options.extend(['-metadata', '%s=%s' % (name, value)]) |
|
|
|
|
|
|
|
|
# https://github.com/rg3/youtube-dl/issues/8350 |
|
|
|
|
|
if info.get('protocol') == 'm3u8_native' or info.get('protocol') == 'm3u8' and self._downloader.params.get('hls_prefer_native', False): |
|
|
|
|
|
options.extend(['-bsf:a', 'aac_adtstoasc']) |
|
|
|
|
|
|
|
|
|
|
|
self._downloader.to_screen('[ffmpeg] Adding metadata to \'%s\'' % filename) |
|
|
self._downloader.to_screen('[ffmpeg] Adding metadata to \'%s\'' % filename) |
|
|
self.run_ffmpeg(filename, temp_filename, options) |
|
|
self.run_ffmpeg(filename, temp_filename, options) |
|
|
os.remove(encodeFilename(filename)) |
|
|
os.remove(encodeFilename(filename)) |
|
@ -467,6 +463,21 @@ class FFmpegFixupM4aPP(FFmpegPostProcessor): |
|
|
return [], info |
|
|
return [], info |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FFmpegFixupM3u8PP(FFmpegPostProcessor): |
|
|
|
|
|
def run(self, info): |
|
|
|
|
|
filename = info['filepath'] |
|
|
|
|
|
temp_filename = prepend_extension(filename, 'temp') |
|
|
|
|
|
|
|
|
|
|
|
options = ['-c', 'copy', '-f', 'mp4', '-bsf:a', 'aac_adtstoasc'] |
|
|
|
|
|
self._downloader.to_screen('[ffmpeg] Fixing malformated aac bitstream in "%s"' % filename) |
|
|
|
|
|
self.run_ffmpeg(filename, temp_filename, options) |
|
|
|
|
|
|
|
|
|
|
|
os.remove(encodeFilename(filename)) |
|
|
|
|
|
os.rename(encodeFilename(temp_filename), encodeFilename(filename)) |
|
|
|
|
|
|
|
|
|
|
|
return [], info |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor): |
|
|
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor): |
|
|
def __init__(self, downloader=None, format=None): |
|
|
def __init__(self, downloader=None, format=None): |
|
|
super(FFmpegSubtitlesConvertorPP, self).__init__(downloader) |
|
|
super(FFmpegSubtitlesConvertorPP, self).__init__(downloader) |
|
|