mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 09:07:58 +01:00
parent
4be9dbdc24
commit
50eff38c1c
1 changed files with 3 additions and 1 deletions
|
@ -730,11 +730,13 @@ def run(self, info):
|
||||||
filename = info['filepath']
|
filename = info['filepath']
|
||||||
temp_filename = prepend_extension(filename, 'temp')
|
temp_filename = prepend_extension(filename, 'temp')
|
||||||
args = ['-c', 'copy']
|
args = ['-c', 'copy']
|
||||||
|
audio_streams = 0
|
||||||
for (i, fmt) in enumerate(info['requested_formats']):
|
for (i, fmt) in enumerate(info['requested_formats']):
|
||||||
if fmt.get('acodec') != 'none':
|
if fmt.get('acodec') != 'none':
|
||||||
args.extend(['-map', f'{i}:a:0'])
|
args.extend(['-map', f'{i}:a:0'])
|
||||||
if self.get_audio_codec(fmt['filepath']) == 'aac':
|
if self.get_audio_codec(fmt['filepath']) == 'aac':
|
||||||
args.extend([f'-bsf:{i}:a:0', 'aac_adtstoasc'])
|
args.extend([f'-bsf:a:{audio_streams}', 'aac_adtstoasc'])
|
||||||
|
audio_streams += 1
|
||||||
if fmt.get('vcodec') != 'none':
|
if fmt.get('vcodec') != 'none':
|
||||||
args.extend(['-map', '%u:v:0' % (i)])
|
args.extend(['-map', '%u:v:0' % (i)])
|
||||||
self.to_screen('Merging formats into "%s"' % filename)
|
self.to_screen('Merging formats into "%s"' % filename)
|
||||||
|
|
Loading…
Reference in a new issue