moq-wg / warp-streaming-format

Drafts intended for IETF MoQ WG
Other
7 stars 2 forks source link

Encryption/DRM info for CMAF #23

Open acbegen opened 1 year ago

acbegen commented 1 year ago

Any plans for providing this info for CMAF selectionParams ?

suhasHere commented 1 year ago

I think this should go in the WARP spec

wilaw commented 1 year ago

The streaming format spec can define what parameters to place, however the catalog should still provide a harmonized location to hold DRM info.

A DASH manifest snippet is shown below. We would need to hold similar information if the catalog is to adequately describe CENC-protected content. We should also be concerned with conciseness, as DRM info can be large compared to the rest of the catalog and we don't want to repeat it for each track if it is common.

<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011"  cenc:default_KID="80399bf5-8a21-4014-8053-e27e748e98c0" />
<ContentProtection value="MSPR 2.0" schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95">
    <cenc:pssh>AAAB...</cenc:pssh>
        <pro xmlns="urn:microsoft:playready">xAEA...</pro>
</ContentProtection>
<ContentProtection value="Widevine" schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
    <cenc:pssh>AAAA...</cenc:pssh>
</ContentProtection>

I propose the following new catalog elements

Field Name Required Location JSON type Definition
Content Protection contentProtection opt R Array Holds a series of content protection objects
Content Protection scheme cpScheme opt CP String Defines the content protection scheme
Content Protection value cpValue opt CP String Defines the content protection scheme value
Default key ID defaultKID opt CP String Defines the default key ID for CENC protected content
Protection System Specific Header pssh opt CP String Defines the base64 encoded contents of the pssh box
PlayReady Object pro opt CP String Defines the base64 encoded contents of the Playready Object
Content protection reference ID cpID R CP String Provides a reference ID to the content protection object
Content protection IDs contentProtectionID opt RT Array Holds an array of Content protection reference IDs

A resultant catalog might look like this for CMAF content in which all tracks are protected with Playready and Widevine via CENC, but the 4K track is only offered in Playready.

{
  "version": 1,
  "sequence": 0,
  "streamingFormat": 1,
  "streamingFormatVersion": "0.2",
  "namespace": "sports.example.com/games/08-08-23/12345",
  "packaging": "cmaf",
  "renderGroup":1,
  "contentProtection": [
      { "cpID":"1",
        "value":"cenc",
        "schemeID":"urn:mpeg:dash:mp4protection:2011",
        "defaultKID":"80399bf5-8a21-4014-8053-e27e748e98c0"
      },
      { "cpID":"2",
        "value":"MSPR 2.0",
        "schemeID":"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",
        "pssh":"AAAB..",
        "pro":"xAEA..."
      },
      { "cpID":"3",
        "value":"Widevine",
        "schemeID":"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
        "pssh":"AAAA.."
      }
  ],
  "contentProtectionID": ["1","2","3"],
  "tracks": [
    {
      "name": "video_4k",
      "selectionParams":{"codec":"avc1.640033","mimeType":"video/mp4","width":3840,"height":2160,"framerate":30,"bitrate":14931538},
      "initTrack":"init_video_4k",
      "altGroup": 1,
      "contentProtectionID": ["1","2"]
    },
    {
      "altGroup": "video_1080",
      "selectionParams":{"codec":"avc1.640028","mimeType":"video/mp4","width":1920,"height":1080,"framerate":30,"bitrate":9914554},
      "initTrack":"init_video_1080",
      "altGroup": 1
    },
    {
      "altGroup": "video_720",
      "selectionParams":{"codec":"avc1.64001f","mimeType":"video/mp4","width":1280,"height":720,"framerate":30,"bitrate":4952892},
      "initTrack":"init_video_720",
      "altGroup": 1
    },
    {
      "altGroup": "audio_aac",
      "selectionParams":{"codec":"mp4a.40.5","mimeType":"audio/mp4","samplerate":48000,"channelConfig":"2","bitrate":67071},
      "initTrack":"init_audio_aac",
      "altGroup": 2
    },
    {
      "name": "audio_ec3",
      "selectionParms":{"codec":"ec-3","mimeType":"audio/mp4","samplerate":48000,"channelConfig":"F801","bitrate":256000},
      "initTrack":"init_audio_ec3",
      "altGroup": 2
    }
   ]
}
acbegen commented 1 year ago

This is fine and is actually a good example why these fields should be registered/maintained by the IANA (we might be missing something today and want to add it quickly in the future).

wilaw commented 1 year ago

Based on discussion at IETF 118, feedback was that catalog itself should not have these CMAF specific fields, but rather that it should be extensible and then the streaming format(s) which wanted to use DRM would define custom extensions to hold that information.