Issue with some AES-128 Streams

#1
Hello,
First, thanks for your app. It is very useful and the record function works very well. The only thing missing is to watch and record another channel at the same time but I know the soft is not old and that it will improve in the future. I'm a dev too.
I was very impressed that ProgTV can play HLS streams even with AES-128. But unfortunately, some don't work. I chose MediaPlayer as playing mode and now it's working but if I want to record, it doesn't work because I think this playing mode hasn't been developped for recording.
I searched for the problem and thought the problem was the IV (Initialization Vector). The streams with issues haven't the IV given.
Ex :

Code: Select all

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:3587
#EXT-X-VERSION:4
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXXXXXXXXX/key597"
#EXTINF:9.96,
http://XXXXXXXXXXXX00003587.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXXXXXXXXX/key598"
#EXTINF:9.96,
http://XXXXXXXXXXXX00003588.ts
#EXTINF:9.96,
http://XXXXXXXXXXXX00003589.ts
#EXTINF:9.96,
http://XXXXXXXXXXXX00003590.ts
#EXTINF:9.96,
http://XXXXXXXXXXXX00003591.ts
I searched a few hours and I learned that the IV is the hexadecimal representation of the media sequence.
So, I made a script to give the IV :

Code: Select all

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:2231
#EXT-X-VERSION:4
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXX/key371",IV=0x000000000000000000000000000008b7
#EXTINF:9.96,
http://XXXXXXXXXXX00002231.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXXXXXXXX/key372",IV=0x000000000000000000000000000008b8
#EXTINF:9.96,
http://XXXXXXXXXXX00002232.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXXXXXXXX/key372",IV=0x000000000000000000000000000008b9
#EXTINF:9.96,
http://XXXXXXXXXXX00002233.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXXXXXXXX/key372",IV=0x000000000000000000000000000008ba
#EXTINF:9.96,
http://XXXXXXXXXXX00002234.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://XXXXXXXXXXX/key372",IV=0x000000000000000000000000000008bb
#EXTINF:9.96,
http://XXXXXXXXXXX00002235.ts
Even with that, it's not working despite working on VLC.
I went back to the stream that worked and I found this :

Code: Select all

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:8875409
#EXT-X-KEY:METHOD=AES-128,URI="https://XXXXXXXXX/2542119.key",IV=0x00000000000000000000000000000000
#EXTINF:6.0000,
20170928T072820-04-8875409.ts
#EXTINF:6.0000,
20170928T072820-04-8875410.ts
#EXTINF:6.0000,
20170928T072820-04-8875411.ts
#EXTINF:6.0000,
20170928T072820-04-8875412.ts
#EXTINF:6.0000,
20170928T072820-04-8875413.ts
#EXTINF:6.0000,
20170928T072820-04-8875414.ts
#EXTINF:6.0000,
20170928T072820-04-8875415.ts
#EXTINF:6.0000,
20170928T072820-04-8875416.ts
#EXTINF:6.0000,
20170928T072820-04-8875417.ts
The IV is null so I think ProgTV don't care about the IV. Can you correct this ?

I sum up the situation to make it easier :
• AES-128 TS segments need IV and key to be decrypted. Currently, ProgTV doesn't care about the IV.
• If there is no IV given in the M3U8, the IV is equal to the hexadecimal representation of the media sequence.

And if you want help for french translation, I can help you because I'm french ;).

Thanks ;)

Re: Issue with some AES-128 Streams

#9
Thanks for the infos.
Is this fixable and are you able to do it ? I have also another stream (from Dailymotion, It's the French YouTube) with AES-128 too and it failed too.
I also tried with FFmpeg (3.4) on PC and it works despite not working with FFmpeg playing mode on ProgTV. But I have some errors in the CMD results.
Here they are if I can help :

Code: Select all

[NULL @ 07580f80] SPS unavailable in decode_picture_timing
[NULL @ 07580f80] non-existing PPS 0 referenced
[h264 @ 07595880] SPS unavailable in decode_picture_timing
[h264 @ 07595880] non-existing PPS 0 referenced
[h264 @ 07595880] decode_slice_header error
[h264 @ 07595880] no frame!
[NULL @ 07580f80] SPS unavailable in decode_picture_timing
[NULL @ 07580f80] non-existing PPS 0 referenced
[h264 @ 07595880] SPS unavailable in decode_picture_timing
[h264 @ 07595880] non-existing PPS 0 referenced
[h264 @ 07595880] decode_slice_header error
[h264 @ 07595880] no frame!
[NULL @ 07580f80] SPS unavailable in decode_picture_timing
[NULL @ 07580f80] non-existing PPS 0 referenced
[h264 @ 07595880] SPS unavailable in decode_picture_timing
[h264 @ 07595880] non-existing PPS 0 referenced
[h264 @ 07595880] decode_slice_header error
[h264 @ 07595880] no frame!
cron