Skip to content

Commit

Permalink
[ffmpeg] Add aac_adtstoasc when merging if needed
Browse files Browse the repository at this point in the history
Related: #1039
  • Loading branch information
pukkandan committed Sep 22, 2021
1 parent a76e2e0 commit a21e0ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions yt_dlp/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,7 @@ def correct_ext(filename, ext=new_ext):
'f%s' % f['format_id'], new_info['ext'])
if not self._ensure_dir_exists(fname):
return
f['filepath'] = fname
downloaded.append(fname)
partial_success, real_download = self.dl(fname, new_info)
info_dict['__real_download'] = info_dict['__real_download'] or real_download
Expand Down
4 changes: 3 additions & 1 deletion yt_dlp/postprocessor/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,9 @@ def run(self, info):
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)
Expand Down

0 comments on commit a21e0ab

Please sign in to comment.