Problem with encrypted HLS
Hi,
I just started testing the HLS encryption and had some trouble playing evo’s playlist. I tested playback with ios safari and ffplay. Both could not play the stream and did not even try fetch the key file. Here is the original playlist:
#EXTM3U
#EXT-X-VERSION:2
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:NO
#EXT-X-MEDIA-SEQUENCE:129
#EXT-X-PROGRAM-DATE-TIME:2013-04-26T12:10:44.983+00:00
#EXT-X-KEY:METHOD=AES-128,URI="2013-04-26T12-10-22.key",IV=385b213a42d8271f1d690d9a8fb173ba
#EXTINF:12,
segment_1366976785802_1366976785802_129.ts
#EXTINF:11,
segment_1366976785802_1366976785802_130.ts
#EXT-X-KEY:METHOD=AES-128,URI="2013-04-26T12-11-17.key",IV=d57714af07fd192f3574a4f8ebc9a645
#EXTINF:10,
segment_1366976785802_1366976785802_131.ts
#EXTINF:11,
segment_1366976785802_1366976785802_132.ts
#EXTINF:11,
segment_1366976785802_1366976785802_133.ts
#EXTINF:11,
segment_1366976785802_1366976785802_134.ts
#EXTINF:12,
segment_1366976785802_1366976785802_135.ts
#EXT-X-KEY:METHOD=AES-128,URI="2013-04-26T12-12-15.key",IV=7d40312399d9bd9aa80b4d33878a835d
#EXTINF:12,
segment_1366976785802_1366976785802_136.ts
#EXTINF:11,
segment_1366976785802_1366976785802_137.ts
#EXTINF:10,
segment_1366976785802_1366976785802_138.ts
The problem seems to be with the IV parameter: Most clients seem to expected the hex value prepended with ‘0x’. As soon as I changed that, safari & ffplay played the stream just fine.
tldr:
evostream generated (did not play):
#EXT-X-KEY:METHOD=AES-128,URI="2013-04-26T12-12-15.key",IV=7d40312399d9bd9aa80b4d33878a835d
prepend ‘0x’ on IV param (played fine):
#EXT-X-KEY:METHOD=AES-128,URI="2013-04-26T12-12-15.key",IV=0x7d40312399d9bd9aa80b4d33878a835d
The HLS spec demands 0x0123ABC.. format for hex strings like the IV:
http://tools.ietf.org/html/draft-pantos … ection-3.2