Encrypted streams with AES?

Just to make sure, because I wasn't able to test that yet. Is Channels m3u8 support allows to play streams that are AES encrypted? My cable operator offers online tv in webbrowser the playlist file looks like this inside:

#EXTM3U
#EXT-X-VERSION:5
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:34904721
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd:/<redacted>,KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1",IV=<redacted>
#EXTINF:2.000,
wp_1_34904721.ts?m=1563941993
#EXTINF:2.000,
wp_1_34904722.ts?m=1563941993
#EXTINF:2.000,
wp_1_34904723.ts?m=1563941993
#EXTINF:2.000,
wp_1_34904724.ts?m=1563941993
#EXTINF:2.000,
wp_1_34904

It only works in the browser, I tried with VLC wih user-agent, referrer fields or with ffmpeg but with no luck, extremely annoying :frowning:

Found this question when searching for the same answer. After additional research, believe the answer is:

Channels Apple TV, VLC and ffmpeg all support unencrypted streams or #EXT-X-KEY:METHOD=AES-128 streams (assuming the URI references a valid keyfile). None of three application support #EXT-X-KEY:METHOD=SAMPLE-AES streams (which is often associated with Apple fairplay technology).

With #EXT-X-KEY:METHOD=AES-128, the encryption is at the file level allowing for relatively simple decryption (with the key). With #EXT-X-KEY:METHOD=SAMPLE-AES, individual components of the video/audio are encrypted and decryption (with the key) must take place during audio/video decoding. ffmpeg could add support at some point, but it is much more technically challenging to implement.

So when looking for video sources to add to Channels, no encryption is best, AES-128 is often possible (Pluto TV uses it) and SAMPLE-AES is not currently possible.

3 Likes

Thank you for informative answer, To be honest I am not sure how to check what AES method use my cable operator.I know they referenced a key file but I don't know what is the syntax of the playlist then?

And in case 3 what if Channels is served decoded stream by some intermediary API?

#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://url-looking-thing,KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1",IV=hex-value

To be honest I am not sure how to check what AES method use my cable operator.

Your m3u sample above shows it. METHOD=SAMPLE-AES tells the decoder that for subsequent segments (until the next #EXT-X-KEY line) decryption must happen after video/audio streams are parsed from their transport container. (The use of METHOD=SAMPLE-AES can vary in real-time. Some channels might use it exclusively and some might use it selectively for specific content.)

And in case 3 what if Channels is served decoded stream by some intermediary API?

Though I have not decoded a METHOD=SAMPLE-AES stream, I have passed other #1/#2 intermediate post-processed hls streams to Channels without issue. RFC8216 (hls) is quite forgiving and flexible aside from SAMPLE-AES.