xbmc / xbmc/inputstream.adaptive

Handle Key Rotation with Zero KID Placeholder [Feature request]

Open
#1,602 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Feature
Dominant language
C++
Stars
531
Forks
270
Avg merge
2d 23h
Merged PRs (30d)
3

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file, test, or entry point is identified. Start by reproducing the logged failure with the supplied MPD and init-segment details, then trace manifest and license-data handling; done means the addon can play a stream whose MPD and init segments use a zero KID placeholder while obtaining the required nonzero KID/PSSH data.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.