Skip to content

Commit

Permalink
[utils] Properly recognize AV1 codec (closes #17506)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Sep 9, 2018
1 parent a2637a2 commit 25d110b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,10 @@ def test_parse_codecs(self):
'vcodec': 'h264',
'acodec': 'aac',
})
self.assertEqual(parse_codecs('av01.0.05M.08'), {
'vcodec': 'av01.0.05M.08',
'acodec': 'none',
})

def test_escape_rfc3986(self):
reserved = "!*'();:@&=+$,/?#[]"
Expand Down
2 changes: 1 addition & 1 deletion youtube_dl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2477,7 +2477,7 @@ def parse_codecs(codecs_str):
vcodec, acodec = None, None
for full_codec in splited_codecs:
codec = full_codec.split('.')[0]
if codec in ('avc1', 'avc2', 'avc3', 'avc4', 'vp9', 'vp8', 'hev1', 'hev2', 'h263', 'h264', 'mp4v', 'hvc1'):
if codec in ('avc1', 'avc2', 'avc3', 'avc4', 'vp9', 'vp8', 'hev1', 'hev2', 'h263', 'h264', 'mp4v', 'hvc1', 'av01'):
if not vcodec:
vcodec = full_codec
elif codec in ('mp4a', 'opus', 'vorbis', 'mp3', 'aac', 'ac-3', 'ec-3', 'eac3', 'dtsc', 'dtse', 'dtsh', 'dtsl'):
Expand Down

0 comments on commit 25d110b

Please sign in to comment.