浏览代码

Merge pull request #9195 from remitamine/ffmpeg-pipe

[downloader/external] enable piping for FFmpegFD(closes #2124)
remitamine 9 年之前
父节点
当前提交
3014b0ae83
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      youtube_dl/downloader/external.py
  2. 2 1
      youtube_dl/postprocessor/ffmpeg.py

+ 1 - 1
youtube_dl/downloader/external.py

@@ -225,7 +225,7 @@ class FFmpegFD(ExternalFD):
 
         args += ['-i', url, '-c', 'copy']
         if protocol == 'm3u8':
-            if self.params.get('hls_use_mpegts', False):
+            if self.params.get('hls_use_mpegts', False) or tmpfilename == '-':
                 args += ['-f', 'mpegts']
             else:
                 args += ['-f', 'mp4', '-bsf:a', 'aac_adtstoasc']

+ 2 - 1
youtube_dl/postprocessor/ffmpeg.py

@@ -175,7 +175,8 @@ class FFmpegPostProcessor(PostProcessor):
         # Always use 'file:' because the filename may contain ':' (ffmpeg
         # interprets that as a protocol) or can start with '-' (-- is broken in
         # ffmpeg, see https://ffmpeg.org/trac/ffmpeg/ticket/2127 for details)
-        return 'file:' + fn
+        # Also leave '-' intact in order not to break streaming to stdout.
+        return 'file:' + fn if fn != '-' else fn
 
 
 class FFmpegExtractAudioPP(FFmpegPostProcessor):