mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-01 07:00:47 +00:00
[downloader/ism] Support ec-3 codec (#5004)
Closes #296 Authored by: nixxo
This commit is contained in:
@@ -138,6 +138,8 @@ def write_piff_header(stream, params):
|
||||
|
||||
if fourcc == 'AACL':
|
||||
sample_entry_box = box(b'mp4a', sample_entry_payload)
|
||||
if fourcc == 'EC-3':
|
||||
sample_entry_box = box(b'ec-3', sample_entry_payload)
|
||||
elif stream_type == 'video':
|
||||
sample_entry_payload += u16.pack(0) # pre defined
|
||||
sample_entry_payload += u16.pack(0) # reserved
|
||||
|
||||
@@ -3124,9 +3124,10 @@ class InfoExtractor:
|
||||
stream_name = stream.get('Name')
|
||||
stream_language = stream.get('Language', 'und')
|
||||
for track in stream.findall('QualityLevel'):
|
||||
fourcc = track.get('FourCC') or ('AACL' if track.get('AudioTag') == '255' else None)
|
||||
KNOWN_TAGS = {'255': 'AACL', '65534': 'EC-3'}
|
||||
fourcc = track.get('FourCC') or KNOWN_TAGS.get(track.get('AudioTag'))
|
||||
# TODO: add support for WVC1 and WMAP
|
||||
if fourcc not in ('H264', 'AVC1', 'AACL', 'TTML'):
|
||||
if fourcc not in ('H264', 'AVC1', 'AACL', 'TTML', 'EC-3'):
|
||||
self.report_warning('%s is not a supported codec' % fourcc)
|
||||
continue
|
||||
tbr = int(track.attrib['Bitrate']) // 1000
|
||||
|
||||
@@ -3546,7 +3546,7 @@ def get_compatible_ext(*, vcodecs, acodecs, vexts, aexts, preferences=None):
|
||||
COMPATIBLE_CODECS = {
|
||||
'mp4': {
|
||||
'av1', 'hevc', 'avc1', 'mp4a', # fourcc (m3u8, mpd)
|
||||
'h264', 'aacl', # Set in ISM
|
||||
'h264', 'aacl', 'ec-3', # Set in ISM
|
||||
},
|
||||
'webm': {
|
||||
'av1', 'vp9', 'vp8', 'opus', 'vrbs',
|
||||
|
||||
Reference in New Issue
Block a user