diff options
author | nixxo <nixxo@protonmail.com> | 2022-09-30 19:33:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-30 23:03:29 +0530 |
commit | 81b6102d2099eec78a2db9ae3d101a8503dd4f25 (patch) | |
tree | 69b04c7b1f06a20e7a569c6a0255f60913699d8a /yt_dlp | |
parent | acf306d1f97486c8c88455cfa294d11c818d41fe (diff) | |
download | hypervideo-pre-81b6102d2099eec78a2db9ae3d101a8503dd4f25.tar.lz hypervideo-pre-81b6102d2099eec78a2db9ae3d101a8503dd4f25.tar.xz hypervideo-pre-81b6102d2099eec78a2db9ae3d101a8503dd4f25.zip |
[downloader/ism] Support ec-3 codec (#5004)
Closes #296
Authored by: nixxo
Diffstat (limited to 'yt_dlp')
-rw-r--r-- | yt_dlp/downloader/ism.py | 2 | ||||
-rw-r--r-- | yt_dlp/extractor/common.py | 5 | ||||
-rw-r--r-- | yt_dlp/utils.py | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/yt_dlp/downloader/ism.py b/yt_dlp/downloader/ism.py index 801b5af81..c961dc62e 100644 --- a/yt_dlp/downloader/ism.py +++ b/yt_dlp/downloader/ism.py @@ -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 diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index d36f025ab..11e715871 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -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 diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 3e2ce8434..6cba9299a 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -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', |