diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-09-22 19:51:40 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-09-22 19:51:58 +0530 |
commit | a21e0ab1a1a03f82517cd8cec4b9a2b4d6b81ac3 (patch) | |
tree | e8d30e2c70e7ea5b999f4f952182f6574881dba9 | |
parent | a76e2e0f8898c06939b6a123fa863ab8876cfa20 (diff) | |
download | hypervideo-pre-a21e0ab1a1a03f82517cd8cec4b9a2b4d6b81ac3.tar.lz hypervideo-pre-a21e0ab1a1a03f82517cd8cec4b9a2b4d6b81ac3.tar.xz hypervideo-pre-a21e0ab1a1a03f82517cd8cec4b9a2b4d6b81ac3.zip |
[ffmpeg] Add `aac_adtstoasc` when merging if needed
Related: #1039
-rw-r--r-- | yt_dlp/YoutubeDL.py | 1 | ||||
-rw-r--r-- | yt_dlp/postprocessor/ffmpeg.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 50e902c53..d05d85604 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2798,6 +2798,7 @@ class YoutubeDL(object): '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 diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index 25488e58b..6f274b196 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -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) |