]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[downloader/external] enable piping for FFmpegFD(closes #2124)
authorremitamine <remitamine@gmail.com>
Thu, 14 Apr 2016 17:48:00 +0000 (18:48 +0100)
committerremitamine <remitamine@gmail.com>
Thu, 14 Apr 2016 17:49:02 +0000 (18:49 +0100)
youtube_dl/downloader/external.py

index 30277dc205787d226360cfc950e5c08796a5fc03..cda39fe9785a5a3d92aba2d4bc0309ec664241a4 100644 (file)
@@ -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']
@@ -235,7 +235,10 @@ class FFmpegFD(ExternalFD):
             args += ['-f', EXT_TO_OUT_FORMATS.get(info_dict['ext'], info_dict['ext'])]
 
         args = [encodeArgument(opt) for opt in args]
-        args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
+        if tmpfilename == '-':
+            args.append('pipe:1')
+        else:
+            args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
 
         self._debug_cmd(args)