carlanton / m3u8-parser

A simple HLS playlist parser for Java
MIT License
184 stars 60 forks source link

Consider adding support for CODECS attribute on EXT-X-MEDIA:TYPE=AUDIO #48

Closed liverhead closed 1 year ago

liverhead commented 2 years ago

Support for CODECS attribute for EXT-X-MEDIA tag is missing. Here is a sample HLS Live manifest:

EXTM3U

EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",CODECS="ac-3",LANGUAGE="spa",NAME="spa-487",AUTOSELECT=YES,DEFAULT=YES,URI=".swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_1/index_new_a_1_0.m3u8"

EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",CODECS="ac-3",LANGUAGE="fra",NAME="fra-488",AUTOSELECT=YES,DEFAULT=NO,URI=".swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_1/index_new_a_1_1.m3u8"

EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",CODECS="ac-3",LANGUAGE="eng",NAME="eng-486",AUTOSELECT=YES,DEFAULT=NO,URI=".swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_1/index_new_a_1_2.m3u8"

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4023828,CODECS="avc1.64002A,ac-3",RESOLUTION=1920x1080,AUDIO="audio"

.swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_4023828/index_new_v_4023828_5.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2710228,CODECS="avc1.42801F,ac-3",RESOLUTION=1280x720,AUDIO="audio"

.swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_2710228/index_new_v_2710228_4.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2355328,CODECS="avc1.42801F,ac-3",RESOLUTION=960x540,AUDIO="audio"

.swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_2355328/index_new_v_2355328_3.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2200728,CODECS="avc1.42801E,ac-3",RESOLUTION=640x360,AUDIO="audio"

.swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_2200728/index_new_v_2200728_2.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2073728,CODECS="avc1.42801E,ac-3",RESOLUTION=480x360,AUDIO="audio"

.swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_2073728/index_new_v_2073728_1.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2044928,CODECS="avc1.42801E,ac-3",RESOLUTION=320x180,AUDIO="audio"

.swn3c0d53a7-eb88-490f-a643-000000000000apple2apple/.rate_2044928/index_new_v_2044928_0.m3u8

carlanton commented 2 years ago

Hm.. is that specified somewhere? Can't find it in the HLS rfc...

I think it is sufficient to specify the audio codec in EXT-X-STREAM-INF?