From e5611e8edac6a0511f72c07ec94828fb0540129b Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 3 Aug 2021 00:01:13 +0530 Subject: [PATCH] [ffmpeg] Fix streaming `mp4` to `stdout` --- yt_dlp/downloader/external.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py index 73c2f9edf..8c8d838e1 100644 --- a/yt_dlp/downloader/external.py +++ b/yt_dlp/downloader/external.py @@ -470,6 +470,7 @@ def _call_downloader(self, tmpfilename, info_dict): if self.params.get('test', False): args += ['-fs', compat_str(self._TEST_FILE_SIZE)] + ext = info_dict['ext'] if protocol in ('m3u8', 'm3u8_native'): use_mpegts = (tmpfilename == '-') or self.params.get('hls_use_mpegts') if use_mpegts is None: @@ -482,8 +483,10 @@ def _call_downloader(self, tmpfilename, info_dict): args += ['-bsf:a', 'aac_adtstoasc'] elif protocol == 'rtmp': args += ['-f', 'flv'] + elif ext == 'mp4' and tmpfilename == '-': + args += ['-f', 'mpegts'] else: - args += ['-f', EXT_TO_OUT_FORMATS.get(info_dict['ext'], info_dict['ext'])] + args += ['-f', EXT_TO_OUT_FORMATS.get(ext, ext)] args = [encodeArgument(opt) for opt in args] args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))