Page 1 of 1

Issue with some AES-128 Streams

Posted: Wed May 02, 2018 2:58 pm
by racacax
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

Posted: Wed May 02, 2018 3:12 pm
by Prog
Can you give me test access to this channel? ProgTV support AES but may be some specific for your provider.

Re: Issue with some AES-128 Streams

Posted: Wed May 02, 2018 3:15 pm
by racacax
No problem, I will give you them in PM.
There will be 2 streams that don't work with ProgTV and the stream that work with ProgTV.

Re: Issue with some AES-128 Streams

Posted: Thu May 03, 2018 6:57 am
by Prog
Total typical AES stream and ProgTV must support that. But not working... More tests in near days.

Re: Issue with some AES-128 Streams

Posted: Thu May 03, 2018 8:28 am
by racacax
Ok, thanks for your help :)
If you want me to test or give you more informations, i'll be there.

Re: Issue with some AES-128 Streams

Posted: Thu May 03, 2018 4:17 pm
by Prog
Hm. Problem not in AES. ProgTV decrypt traffic. But PSI tables looks very bad. I try 2 TS analyzers.
What region? What provider name?

Re: Issue with some AES-128 Streams

Posted: Thu May 03, 2018 4:35 pm
by racacax
The streams are from France. It's SFR. We should not have access to it like that (only in their apps or website) but I made a script.

What are PSI tables ?

Re: Issue with some AES-128 Streams

Posted: Thu May 03, 2018 5:17 pm
by Prog
Information about streams, audio, video,...
https://en.wikipedia.org/wiki/MPEG_tran ... tion_(PSI)

PAT present (with CRC) but PMT is empty.

Re: Issue with some AES-128 Streams

Posted: Thu May 03, 2018 6:14 pm
by racacax
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!

Re: Issue with some AES-128 Streams

Posted: Sat May 05, 2018 12:51 pm
by Prog
Do you have same problem on all channels or only 2-3 from all list?

Re: Issue with some AES-128 Streams

Posted: Sat May 05, 2018 2:03 pm
by racacax
I have the same problem with all channels. It's strange that even FFMpeg playing mode can't play it. Is there any debug mode or something ?

Re: Issue with some AES-128 Streams

Posted: Sat May 05, 2018 3:01 pm
by Prog
ProgTV not can detect audio and video pid because empty pmt table. I am looking solution

Re: Issue with some AES-128 Streams

Posted: Sat May 05, 2018 4:36 pm
by racacax
OK, thanks a lot. Good luck !