0

I am trying to debug a DRM problem, I have with one of my HLS streams. I want to extract the IV (initialization vector) value for the segments. Normally if it is used constant_IV the IV the default_constant_IV is advertised in the init.mp4 file. In my case the packager is using a slightly different approach and is advertising default_Per_Sample_IV_Size but in this case I cannot get the IV. I was using mp4dump to decode the header and in one case we have:

$ mp4dump init.mp4
[ftyp] size=8+16
  major_brand = iso5
  minor_version = 1
  compatible_brand = iso5
  compatible_brand = dash
[free] size=8+0
[free] size=8+66
[moov] size=8+876
  [mvhd] size=12+96
    timescale = 600
    duration = 0
    duration(ms) = 0
  [iods] size=12+15
    [InitialObjectDescriptor] size=2+13
      id = 1
      include inline profile level flag = 0
      OD profile level = ff
      scene profile level = ff
      audio profile level = ff
      visual profile level = 7f
      graphics profile level = ff
      [ES_ID_Inc] size=2+4
        track_id = 1
  [mvex] size=8+64
    [mehd] size=12+4
      duration = 440400
    [trex] size=12+20
      track id = 1
      default sample description index = 1
      default sample duration = 0
      default sample size = 0
      default sample flags = 10000
    [trep] size=8+8
  [trak] size=8+661
    [tkhd] size=12+80, flags=7
      enabled = 1
      id = 1
      duration = 0
      width = 512.000000
      height = 288.000000
    [edts] size=8+28
      [elst] size=12+16
        entry_count = 1
        entry/segment duration = 0
        entry/media time = 2
        entry/media rate = 1
    [mdia] size=8+525
      [mdhd] size=12+20
        timescale = 24
        duration = 0
        duration(ms) = 0
        language = und
      [hdlr] size=12+48
        handler_type = vide
        handler_name = L-SMASH Video Media Handler
      [minf] size=8+425
        [vmhd] size=12+8, flags=1
          graphics_mode = 0
          op_color = 0000,0000,0000
        [dinf] size=8+28
          [dref] size=12+16
            [url ] size=12+0, flags=1
              location = [local to file]
        [stbl] size=8+361
          [stsd] size=12+281
            entry_count = 1
            [encv] size=8+269
              data_reference_index = 1
              width = 512
              height = 288
              compressor = AVC Coding
              [pasp] size=8+8
              [avcC] size=8+48
                Configuration Version = 1
                Profile = High
                Profile Compatibility = 0
                Level = 31
                NALU Length Size = 4
                Sequence Parameter = [67 64 00 1f ac 72 04 40 80 25 b0 11 00 00 03 00 01 00 00 03 00 30 8f 18 31 84 60]
                Picture Parameter = [68 e8 43 b2 c8 b0]
              [sinf] size=8+72
                [frma] size=8+4
                  original_format = avc1
                [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 = [9e b4 05 0d e4 4b 48 02 93 2e 27 d7 50 83 e2 66]
              [btrt] size=8+12
              [colr] size=8+11
          [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

I have used the reference MPEG-DASH stream from this MPD link

and if I am having default_constant_IV_size the IV vector is available at default_constant_IV, here I have deleted/masked the KID and IV:

[schi] size=8+49
     [tenc] size=12+37, version=1
         default_isProtected = 1
         default_Per_Sample_IV_Size = 0
         default_KID = [(masked)]
         default_crypt_byte_block = 1
         default_skip_byte_block = 9
         default_constant_IV_size = 16
         default_constant_IV = [(masked)]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.