mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-11 12:39:59 +00:00
changes to use libavformat runtime version when adding aac_adtstoasc filter
This commit is contained in:
parent
a803582717
commit
7b0a9430da
@ -321,7 +321,7 @@ class FFmpegFD(ExternalFD):
|
||||
args += ['-f', 'mpegts']
|
||||
else:
|
||||
args += ['-f', 'mp4']
|
||||
if (ffpp.basename == 'ffmpeg' and is_outdated_version(ffpp._versions['ffmpeg'], '3.2', False)) and (not info_dict.get('acodec') or info_dict['acodec'].split('.')[0] in ('aac', 'mp4a')):
|
||||
if (ffpp.basename == 'ffmpeg' and is_outdated_version(ffpp._lavf_version, '57.56.100', False)) 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']
|
||||
|
@ -77,7 +77,19 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
prefer_ffmpeg = True
|
||||
|
||||
def get_ffmpeg_version(path):
|
||||
ver = get_exe_version(path, args=['-version'])
|
||||
if os.path.basename(path) == 'ffmpeg':
|
||||
# get ffmpeg and libavformat runtime versions
|
||||
vers = get_exe_version(
|
||||
path, args=['-version'],
|
||||
version_re=r'(?s)version\s+([-0-9._a-zA-Z]+)(?:.*?libavformat.*?/\s+([0-9. ]+))?')
|
||||
if isinstance(vers, (list, tuple)):
|
||||
ver = vers[0]
|
||||
if len(vers) > 1 and vers[1]:
|
||||
self._lavf_version = vers[1].replace(' ', '')
|
||||
else:
|
||||
ver = vers
|
||||
else:
|
||||
ver = get_exe_version(path, args=['-version'])
|
||||
if ver:
|
||||
regexs = [
|
||||
r'(?:\d+:)?([0-9.]+)-[0-9]+ubuntu[0-9.]+$', # Ubuntu, see [1]
|
||||
@ -95,6 +107,7 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
|
||||
self._paths = None
|
||||
self._versions = None
|
||||
self._lavf_version = None
|
||||
if self._downloader:
|
||||
prefer_ffmpeg = self._downloader.params.get('prefer_ffmpeg', True)
|
||||
location = self._downloader.params.get('ffmpeg_location')
|
||||
|
@ -3800,7 +3800,10 @@ def detect_exe_version(output, version_re=None, unrecognized='present'):
|
||||
version_re = r'version\s+([-0-9._a-zA-Z]+)'
|
||||
m = re.search(version_re, output)
|
||||
if m:
|
||||
return m.group(1)
|
||||
if len(m.groups()) == 1:
|
||||
return m.group(1)
|
||||
else:
|
||||
return m.groups()
|
||||
else:
|
||||
return unrecognized
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user