summary refs log tree commit diff
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-04-16 22:00:49 +0100
committerremitamine <remitamine@gmail.com>2016-04-16 22:00:49 +0100
commit3014b0ae835e3f42b5f3628464ed7e4b2557ef6c (patch)
treeff24c0e13caaa1c4ee821e1fbbd14aee5ddbba45
parentbbb3f730bb729d258675dbc132f7daf6099edbba (diff)
parentb9f2fdd37fe2085deb09710a2084c940e9920304 (diff)
downloadyoutube-dl-3014b0ae835e3f42b5f3628464ed7e4b2557ef6c.tar.gz
youtube-dl-3014b0ae835e3f42b5f3628464ed7e4b2557ef6c.tar.xz
youtube-dl-3014b0ae835e3f42b5f3628464ed7e4b2557ef6c.zip
Merge pull request #9195 from remitamine/ffmpeg-pipe
[downloader/external] enable piping for FFmpegFD(closes #2124)
-rw-r--r--youtube_dl/downloader/external.py2
-rw-r--r--youtube_dl/postprocessor/ffmpeg.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py
index 30277dc20..8d642fc3e 100644
--- a/youtube_dl/downloader/external.py
+++ b/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']
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py
index b64cd396b..1793a878c 100644
--- a/youtube_dl/postprocessor/ffmpeg.py
+++ b/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):