1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-04 00:55:15 +00:00

[ffmpeg] Add aac_adtstoasc when merging if needed

Related: #1039
This commit is contained in:
pukkandan
2021-09-22 19:51:40 +05:30
parent a76e2e0f88
commit a21e0ab1a1
2 changed files with 4 additions and 1 deletions

View File

@ -732,7 +732,9 @@ class FFmpegMergerPP(FFmpegPostProcessor):
args = ['-c', 'copy']
for (i, fmt) in enumerate(info['requested_formats']):
if fmt.get('acodec') != 'none':
args.extend(['-map', '%u:a:0' % (i)])
args.extend(['-map', f'{i}:a:0'])
if self.get_audio_codec(fmt['filepath']) == 'aac':
args.extend([f'-bsf:{i}:a:0', 'aac_adtstoasc'])
if fmt.get('vcodec') != 'none':
args.extend(['-map', '%u:v:0' % (i)])
self.to_screen('Merging formats into "%s"' % filename)