Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Key Rotation with Zero KID Placeholder [Feature request] #1602

Open
bencooper1 opened this issue Jul 20, 2024 · 1 comment
Open

Handle Key Rotation with Zero KID Placeholder [Feature request] #1602

bencooper1 opened this issue Jul 20, 2024 · 1 comment
Labels
Type: Feature non-breaking change which adds functionality

Comments

@bencooper1
Copy link

bencooper1 commented Jul 20, 2024

Describe the feature

I found out that some manifest stream using key rotation with Zero KID placeholder (no pssh or kid information in mpd file and init segments) and inputstream.adaptive can not extract kid/pssh. With the same stream on desktop browser and using eme logger, I still able to get "quite long pssh" value and tried to decode it using Axinom Portal and saw that three is still kid value different than 0.

If it is possible to process this kind of MPD stream with inputstream.adaptive would be great! Thank you all!

2024-07-20 16:52:27.052 T:294952    info <general>: AddOnLog: inputstream.adaptive: Manifest successfully parsed (Periods: 1, Streams in first period: 4, Type: live)
2024-07-20 16:52:27.196 T:294952   error <general>: AddOnLog: inputstream.adaptive: License data: Cannot extract PSSH/KID data from the stream
2024-07-20 16:52:27.196 T:294952 warning <general>: AddOnLog: inputstream.adaptive: Initializing stream with unknown KID!

Here is information from mp4dump of init.m4s file to show that it has zero hex KID or PSSH:

[ftyp] size=8+16
  major_brand = iso5
  minor_version = 200
  compatible_brand = iso6
  compatible_brand = mp41
[moov] size=8+750
  [mvhd] size=12+96
    timescale = 1000
    duration = 0
    duration(ms) = 0
  [trak] size=8+496
    [tkhd] size=12+80, flags=3
      enabled = 1
      id = 1
      duration = 0
      width = 0.000000
      height = 0.000000
    [mdia] size=8+396
      [mdhd] size=12+20
        timescale = 48000
        duration = 0
        duration(ms) = 0
        language = und
      [hdlr] size=12+33
        handler_type = soun
        handler_name = SoundHandler
      [minf] size=8+311
        [smhd] size=12+4
          balance = 0
        [dinf] size=8+28
          [dref] size=12+16
            [url ] size=12+0, flags=1
              location = [local to file]
        [stbl] size=8+251
          [stsd] size=12+171
            entry_count = 1
            [enca] size=8+159
              data_reference_index = 1
              channel_count = 2
              sample_size = 16
              sample_rate = 48000
              [esds] size=12+39
                [ESDescriptor] size=5+34
                  es_id = 1
                  stream_priority = 0
                  [DecoderConfig] size=5+20
                    stream_type = 5
                    object_type = 64
                    up_stream = 0
                    buffer_size = 0
                    max_bitrate = 127875
                    avg_bitrate = 0
                    DecoderSpecificInfo = 11 90 
                  [Descriptor:06] size=5+1
              [sinf] size=8+72
                [frma] size=8+4
                  original_format = mp4a
                [schm] size=12+8
                  scheme_type = cenc
                  scheme_version = 65536
                [schi] size=8+32
                  [tenc] size=12+20
                    default_isProtected = 1
                    default_Per_Sample_IV_Size = 8
                    default_KID = [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
          [stts] size=12+4
            entry_count = 0
          [stsc] size=12+4
            entry_count = 0
          [stsz] size=12+8
            sample_size = 0
            sample_count = 0
          [stco] size=12+4
            entry_count = 0
  [mvex] size=8+32
    [trex] size=12+20
      track id = 1
      default sample description index = 1
      default sample duration = 0
      default sample size = 0
      default sample flags = 0
  [udta] size=8+90
    [meta] size=12+78
      [hdlr] size=12+21
        handler_type = mdir
        handler_name = 
      [ilst] size=8+37
        [.too] size=8+29
          [data] size=8+21
            type = 1
            lang = 0
            value = Lavf58.27.103

Motivation

inputstream.adaptive can play very well normal mpd stream on Kodi but fail to play mpd stream with Key Rotation with Zero KID Placeholder.

Are you willing to contribute in development?

No

Should a possible backport be considered?

No

@bencooper1 bencooper1 added the Type: Feature non-breaking change which adds functionality label Jul 20, 2024
@CastagnaIT
Copy link
Collaborator

by assuming for widevine this sample stream should help us to make a future implementation

{
  "name": "Sintel - 3 minutes key rotation",
  "uri": "https://storage.googleapis.com/playerinfra/wv/sintel_3min_rotate.mpd",
  "drm_scheme": "widevine",
  "drm_multi_session": true,
  "drm_license_url": "https://widevine-proxy.appspot.com/proxy"
}

it will be a long-term thing (many months) at least from my part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature non-breaking change which adds functionality
Projects
None yet
Development

No branches or pull requests

2 participants