HLS support for SESSION_KEYS
This stream which play fine in other player don't work in VLC: https://live-vrt.akamaized.net/groupc/live/8edf3bdf-7db3-41c3-a318-72cb7f82de66/live_aes.isml/playlist.m3u8
I tried with VLC Version 3.x and 4.x under Windows 7
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Rémi Denis-Courmont assigned to @fcartegnie
assigned to @fcartegnie
- Rémi Denis-Courmont added Component::Input: network streams label
added Component::Input: network streams label
The manifest contains EXT-X-SESSION-KEY containing link to a drm/session key.\ In the past I've already encountered streams with protection policies (DRM, TTL tokens and so on) that were not handled by VLC.\ Is that an expected behaviour or a bug ?\
As the following lines return nothing, it must be not implemented.
/vlc-3.0.6$ sudo grep -R "EXT-X-SESSION-KEY" . /vlc-3.0.6$ sudo grep -R "EXT-X-SESSION-DATA" .
These new keys are part of RFC 8216.
Here is the concerned manifest:
#EXTM3U #EXT-X-VERSION:4 ## Created with Unified Streaming Platform(version=1.8.5) #EXT-X-SESSION-KEY:METHOD=AES-128,URI="https://aes-license.drm.technology/aes/getkey/vrt/8edf3bdf-7db3-41c3-a318-72cb7f82de66" # AUDIO groups #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-64",NAME="Dutch/Flemish",LANGUAGE="nl",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="2" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-128",NAME="Dutch/Flemish",LANGUAGE="nl",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="2" # SUBTITLES groups #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",NAME="Dutch/Flemish",LANGUAGE="nl",AUTOSELECT=YES,DEFAULT=YES,URI="live_aes-text_track_0_dut=1000.m3u8" # variants #EXT-X-STREAM-INF:BANDWIDTH=245000,AVERAGE-BANDWIDTH=223000,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=416x234,FRAME-RATE=25,AUDIO="audio-aacl-64",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE live_aes-audio_track_0_dut=64000-video=145000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=576000,AVERAGE-BANDWIDTH=524000,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=480x270,FRAME-RATE=25,AUDIO="audio-aacl-128",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE live_aes-audio_track_0_dut=128000-video=365000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1002000,AVERAGE-BANDWIDTH=911000,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=640x360,FRAME-RATE=25,AUDIO="audio-aacl-128",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE live_aes-audio_track_0_dut=128000-video=730000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1433000,AVERAGE-BANDWIDTH=1303000,CODECS="mp4a.40.2,avc1.42C01F",RESOLUTION=768x432,FRAME-RATE=25,AUDIO="audio-aacl-128",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE live_aes-audio_track_0_dut=128000-video=1100000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2483000,AVERAGE-BANDWIDTH=2257000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,AUDIO="audio-aacl-128",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE live_aes-audio_track_0_dut=128000-video=2000000.m3u8 # keyframes #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=22000,CODECS="avc1.42C01E",RESOLUTION=416x234,URI="keyframes/live_aes-video=145000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=54000,CODECS="avc1.42C01E",RESOLUTION=480x270,URI="keyframes/live_aes-video=365000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=107000,CODECS="avc1.42C01E",RESOLUTION=640x360,URI="keyframes/live_aes-video=730000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=161000,CODECS="avc1.42C01F",RESOLUTION=768x432,URI="keyframes/live_aes-video=1100000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=292000,CODECS="avc1.4D401F",RESOLUTION=960x540,URI="keyframes/live_aes-video=2000000.m3u8"
After further investigations it seems that many part of RFC 8216 are not implemented in the VLC/modules/demux/hls.
The following keys are not in VLC/modules/demux/hls/playlist/tags.cpp (const exttagmapping)
4.3.1.2. EXT-X-VERSION .............................12 4.3.2.2. EXT-X-BYTERANGE ...........................14 4.3.2.7. EXT-X-DATERANGE ...........................18 4.3.4.3. EXT-X-I-FRAME-STREAM-INF ..................33 4.3.4.4. EXT-X-SESSION-DATA ........................34 4.3.4.5. EXT-X-SESSION-KEY .........................35 4.3.5.1. EXT-X-INDEPENDENT-SEGMENTS ................35 4.3.5.2. EXT-X-START ...............................36
Note : EXT-X-VERSION is not in mapping table but tested in switch case bellow it, must have been forgotten.
In our exemple it means that the following playlist line is never properly parsed:
#EXT-X-SESSION-KEY:METHOD=AES-128,URI="https://aes-license.drm.technology/aes/getkey/vrt/8edf3bdf-7db3-41c3-a318-72cb7f82de66"
As #EXT-X-SESSION-KEY is not implemented, no call to given URI is done to get AES_128 decoding key.
If i'm right, the same mechanism of decoding as in #EXT-X-KEY case must be done. (ex: VLC/modules/demux/hls/playlist/Parser.cpp)
I'm up to try implementing it, even if cpp isn't my main language. I'll try to provide a patch in the following weeks.
@François Cartegnie let me know if it's not already done but not merged on your side.
- François Cartegnie changed title from A valid stream don't play in VLC to HLS support for SESSION_KEYS
changed title from A valid stream don't play in VLC to HLS support for SESSION_KEYS
- François Cartegnie added Component::Demuxers label and removed Component::Input: network streams label
added Component::Demuxers label and removed Component::Input: network streams label
- François Cartegnie added Severity::normal label
added Severity::normal label
- François Cartegnie changed milestone to %Features paradize
changed milestone to %Features paradize
- Developer
Replying to [comment:4 Grégoire Cutzach]:
After further investigations it seems that many part of RFC 8216 are not implemented in the VLC/modules/demux/hls.
You're wrong. SESSION_KEY is another example of how broken HLS is. Its only purpose is to PRELOAD a unique KEY...
If the stream doesn't work, that's another issue, since the KEY is still mandatory, because content can be encrypted... or not, and AES-128 CBC can't tell.
- Developer
- François Cartegnie added Status::fixed label
added Status::fixed label
- François Cartegnie closed
closed
- Jean-Baptiste Kempf added Component::Demux: Adaptive label and removed Component::Demuxers label
added Component::Demux: Adaptive label and removed Component::Demuxers label