about summary refs log tree commit diff
path: root/youtube_dl/downloader
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-02-02 08:05:16 +0100
committerRemita Amine <remitamine@gmail.com>2017-02-02 08:07:28 +0100
commit8bdc149441a86e01c56946090087c005a525260e (patch)
tree2d6250dd5c5e58968105184d7e7894245e1cc05b /youtube_dl/downloader
parent020c5df52d61af0630be8c982282e110a83fc8df (diff)
downloadyoutube-dl-8bdc149441a86e01c56946090087c005a525260e.tar.gz
youtube-dl-8bdc149441a86e01c56946090087c005a525260e.tar.xz
youtube-dl-8bdc149441a86e01c56946090087c005a525260e.zip
[downloader/external:ffmpeg] minimize the use of aac_adtstoasc filter
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r--youtube_dl/downloader/external.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py
index 5d3e5d8d3..138f353ef 100644
--- a/youtube_dl/downloader/external.py
+++ b/youtube_dl/downloader/external.py
@@ -17,6 +17,7 @@ from ..utils import (
     encodeArgument,
     handle_youtubedl_headers,
     check_executable,
+    is_outdated_version,
 )
 
 
@@ -264,7 +265,9 @@ class FFmpegFD(ExternalFD):
             if self.params.get('hls_use_mpegts', False) or tmpfilename == '-':
                 args += ['-f', 'mpegts']
             else:
-                args += ['-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
+                args += ['-f', 'mp4']
+                if (ffpp.basename == 'ffmpeg' and is_outdated_version(ffpp._versions['ffmpeg'], '3.2')) and (not info_dict.get('acodec') or info_dict['acodec'].split('.')[0] in ('aac', 'mp4a')):
+                    args += ['-bsf:a', 'aac_adtstoasc']
         elif protocol == 'rtmp':
             args += ['-f', 'flv']
         else: