2013-10-17 21:10:38 +00:00
|
|
|
// This file defines the protocol between Muxer and classes for generating MPD
|
|
|
|
// files.
|
|
|
|
|
|
|
|
syntax = "proto2";
|
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
package shaka;
|
2013-10-17 21:10:38 +00:00
|
|
|
|
|
|
|
message Range {
|
|
|
|
optional uint64 begin = 1;
|
|
|
|
optional uint64 end = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message MediaInfo {
|
2014-01-06 20:00:14 +00:00
|
|
|
enum ContainerType {
|
|
|
|
CONTAINER_UNKNOWN = 0;
|
|
|
|
CONTAINER_MP4 = 1;
|
|
|
|
CONTAINER_MPEG2_TS= 2;
|
|
|
|
CONTAINER_WEBM = 3;
|
2015-10-29 20:58:36 +00:00
|
|
|
CONTAINER_TEXT = 4;
|
2018-05-07 23:08:09 +00:00
|
|
|
CONTAINER_PACKED_AUDIO = 5;
|
2014-01-06 20:00:14 +00:00
|
|
|
}
|
|
|
|
|
2013-10-17 21:10:38 +00:00
|
|
|
message VideoInfo {
|
|
|
|
optional string codec = 1;
|
2015-06-09 22:29:14 +00:00
|
|
|
|
|
|
|
// The width and height of the actual number of pixels. This will not be the
|
|
|
|
// same as the visual width and height if the sample aspect ratio (sar)
|
|
|
|
// is not 1:1.
|
2013-10-17 21:10:38 +00:00
|
|
|
optional uint32 width = 2;
|
|
|
|
optional uint32 height = 3;
|
2015-06-09 22:29:14 +00:00
|
|
|
|
2013-12-11 00:27:25 +00:00
|
|
|
optional uint32 time_scale = 4;
|
2013-10-17 21:10:38 +00:00
|
|
|
// Relative to |time_scale|. IOW |time_scale| / |frame_duration| is the
|
|
|
|
// framerate.
|
2013-12-11 00:27:25 +00:00
|
|
|
optional uint64 frame_duration = 5;
|
|
|
|
optional bytes decoder_config = 6;
|
2015-06-09 22:29:14 +00:00
|
|
|
|
|
|
|
// pixel_width:pixel_height is the the sample aspect ratio (sar) of the
|
|
|
|
// video.
|
|
|
|
// Note that (pixel_width * width):(pixel_height * height) is the picture
|
|
|
|
// aspect ratio, or the @par attribute set on AdaptationSet element.
|
|
|
|
optional uint32 pixel_width = 7;
|
|
|
|
optional uint32 pixel_height = 8;
|
2017-03-21 23:14:46 +00:00
|
|
|
|
|
|
|
// playback_rate: the playout capability (e.g., 4x, 8x, 16x fast foward) of
|
|
|
|
// the trick play stream.
|
2017-05-16 16:59:52 +00:00
|
|
|
optional uint32 playback_rate = 9;
|
2019-09-23 06:24:33 +00:00
|
|
|
|
|
|
|
// Transfer characteristics. Useful to determine the VIDEO-RANGE for HLS,
|
|
|
|
// i.e. whether it is SDR or HDR.
|
|
|
|
optional uint32 transfer_characteristics = 10;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message AudioInfo {
|
|
|
|
optional string codec = 1;
|
|
|
|
optional uint32 sampling_frequency = 2;
|
2013-12-11 00:27:25 +00:00
|
|
|
optional uint32 time_scale = 3;
|
|
|
|
optional uint32 num_channels = 4;
|
|
|
|
optional string language = 5;
|
|
|
|
optional bytes decoder_config = 6;
|
2016-02-09 00:22:01 +00:00
|
|
|
optional AudioCodecSpecificData codec_specific_data = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AudioCodecSpecificData {
|
|
|
|
// EC3 Channel map bit fields, encoded based on ETSI TS 102 366 V1.3.1
|
|
|
|
// Digital Audio Compression (AC-3, Enhanced AC-3) Standard E.1.3.1.8.
|
2020-07-04 21:55:28 +00:00
|
|
|
// Or AC4 Channel mask bit fields, encoded based on ETSI TS 103 190-2
|
|
|
|
// V1.2.1 Digital Audio Compression (AC-4) Standard; Part 2: Immersive and
|
|
|
|
// personalized audio E.10.14.
|
|
|
|
optional uint32 channel_mask = 1;
|
2020-06-04 05:02:49 +00:00
|
|
|
|
|
|
|
// EC3 Channel configuration descriptor with MPEG scheme fields,
|
|
|
|
// encoded based on ETSI TS 102 366 V1.4.1 Digital Audio Compression
|
|
|
|
// (AC-3, Enhanced AC-3) Standard I.1.2.1.
|
2020-07-04 21:55:28 +00:00
|
|
|
// Or AC4 Channel configuration descriptor with MPEG scheme fields,
|
|
|
|
// encoded based on ETSI TS 103 190-2 V1.2.1 Digital Audio Compression
|
|
|
|
// (AC-4) Standard; Part 2: Immersive and personalized audio G.3.2.
|
|
|
|
optional uint32 channel_mpeg_value = 2;
|
2020-06-04 05:02:49 +00:00
|
|
|
|
|
|
|
// Dolby Digital Plus JOC decoding complexity fields, ETSI TS 103 420 v1.2.1
|
|
|
|
// Backwards-compatible object audio carriage using Enhanced AC-3 Standard
|
|
|
|
// C.3.2.3.
|
|
|
|
optional uint32 ec3_joc_complexity = 3;
|
2020-07-04 21:55:28 +00:00
|
|
|
|
|
|
|
// AC4 Immersive stereo flag field, based on Dolby AC-4 in MPEG-DASH for
|
|
|
|
// Online Delivery Specification 2.5.3.
|
|
|
|
// https://developer.dolby.com/tools-media/online-delivery-kits/dolby-ac-4/
|
|
|
|
optional bool ac4_ims_flag = 4;
|
|
|
|
|
|
|
|
// AC4 Channel-based audio (CBI) flag field, encoded based on
|
|
|
|
// ETSI TS 103 190-2 Digital Audio Compression (AC-4) Standard;
|
|
|
|
// Part 2: Immersive and personalized audio 4.3.
|
|
|
|
optional bool ac4_cbi_flag = 5;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message TextInfo {
|
2015-10-29 20:58:36 +00:00
|
|
|
enum TextType {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
CAPTION = 1;
|
|
|
|
SUBTITLE = 2;
|
|
|
|
}
|
2018-02-26 20:13:28 +00:00
|
|
|
optional string codec = 1;
|
2013-10-17 21:10:38 +00:00
|
|
|
optional string language = 2;
|
2015-10-29 20:58:36 +00:00
|
|
|
optional TextType type = 3;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
2015-07-08 00:52:28 +00:00
|
|
|
message ProtectedContent {
|
|
|
|
message ContentProtectionEntry {
|
|
|
|
// Human readable UUID of the DRM.
|
|
|
|
optional string uuid = 1;
|
|
|
|
// Human readable DRM name and version string.
|
|
|
|
// e.g. "My Content Protection v1.0"
|
|
|
|
optional string name_version = 2;
|
|
|
|
// The raw 'pssh' box for the media.
|
|
|
|
optional bytes pssh = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The default key ID for the encrypted media.
|
|
|
|
optional bytes default_key_id = 1;
|
|
|
|
repeated ContentProtectionEntry content_protection_entry = 2;
|
2016-04-21 23:21:16 +00:00
|
|
|
// Specifies the protection scheme: 'cenc', 'cens', 'cbc1', 'cbcs'.
|
2017-04-04 20:57:50 +00:00
|
|
|
// "cbca" is also valid which is a place holder for SAMPLE-AES encryption.
|
2016-04-21 23:21:16 +00:00
|
|
|
optional string protection_scheme = 3 [default = 'cenc'];
|
2020-04-17 17:20:03 +00:00
|
|
|
optional bool include_mspr_pro = 4 [default = true];
|
2015-07-08 00:52:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(rkuroiwa): Remove this. <ContentProtection> element that must be added
|
|
|
|
// should be done by directly using the MpdBuilder interface.
|
|
|
|
// Use this to specify ContentProtection elements that should be set in
|
|
|
|
// the MPD, if ContentProtectionEntry is not sufficient.
|
2014-01-10 20:04:09 +00:00
|
|
|
message ContentProtectionXml {
|
|
|
|
message AttributeNameValuePair {
|
|
|
|
optional string name = 1;
|
|
|
|
optional string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Element {
|
2014-01-14 22:56:06 +00:00
|
|
|
optional string name = 1;
|
|
|
|
repeated AttributeNameValuePair attributes = 2;
|
|
|
|
repeated Element subelements = 3;
|
2014-01-10 20:04:09 +00:00
|
|
|
}
|
|
|
|
|
2014-01-14 22:56:06 +00:00
|
|
|
// These two string fields are specified by the MPD spec. Just for
|
|
|
|
// clarification, the string set in |value| is the rhs of 'value' field in
|
|
|
|
// <ContentProtection>.
|
2014-01-10 20:04:09 +00:00
|
|
|
optional string scheme_id_uri = 1;
|
|
|
|
optional string value = 2;
|
|
|
|
repeated AttributeNameValuePair attributes = 3;
|
|
|
|
repeated Element subelements = 4;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
optional uint32 bandwidth = 1;
|
2015-06-09 23:58:32 +00:00
|
|
|
|
|
|
|
// Note that DASH IOP v3.0 explicitly mentions that a segment should only
|
|
|
|
// have one {video, audio, text} track.
|
|
|
|
optional VideoInfo video_info = 2;
|
|
|
|
optional AudioInfo audio_info = 3;
|
|
|
|
optional TextInfo text_info = 4;
|
2014-01-10 20:04:09 +00:00
|
|
|
repeated ContentProtectionXml content_protections = 5;
|
2013-10-17 21:10:38 +00:00
|
|
|
|
2015-07-08 00:52:28 +00:00
|
|
|
// This is set if the content is protected with a content protection,
|
|
|
|
// i.e. encrypted.
|
|
|
|
optional ProtectedContent protected_content = 15;
|
|
|
|
|
2013-12-18 01:17:35 +00:00
|
|
|
// This is the reference time scale if there are multiple VideoInfo and/or
|
|
|
|
// AudioInfo.
|
|
|
|
optional uint32 reference_time_scale = 13;
|
2018-01-03 00:10:54 +00:00
|
|
|
optional uint64 presentation_time_offset = 16;
|
2014-01-06 20:00:14 +00:00
|
|
|
optional ContainerType container_type = 14 [default = CONTAINER_UNKNOWN];
|
2013-12-18 01:17:35 +00:00
|
|
|
|
2013-10-17 21:10:38 +00:00
|
|
|
// VOD only.
|
2013-12-11 00:27:25 +00:00
|
|
|
optional Range init_range = 6;
|
|
|
|
optional Range index_range = 7;
|
|
|
|
optional string media_file_name = 8;
|
2013-10-17 21:10:38 +00:00
|
|
|
// END VOD only.
|
|
|
|
|
2017-02-09 00:42:44 +00:00
|
|
|
// VOD and static LIVE.
|
|
|
|
optional float media_duration_seconds = 9;
|
|
|
|
|
2013-10-17 21:10:38 +00:00
|
|
|
// LIVE only.
|
2013-12-11 00:27:25 +00:00
|
|
|
optional string init_segment_name = 10;
|
|
|
|
optional string segment_template = 11;
|
2013-10-17 21:10:38 +00:00
|
|
|
// This value is the user input “segment duration”.
|
|
|
|
// This value is not necessarily the same as the value passed to
|
|
|
|
// MpdNotifier::NotifyNewSegment().
|
2017-09-25 19:18:50 +00:00
|
|
|
optional float segment_duration_seconds = 12 [deprecated = true];
|
2013-10-17 21:10:38 +00:00
|
|
|
// END LIVE only.
|
2018-04-17 17:42:45 +00:00
|
|
|
|
|
|
|
// URL fields for the corresponding file_name fields above.
|
|
|
|
// The file names are adjusted to be relative to DASH MPD or HLS media
|
|
|
|
// playlist, or with base url prepended.
|
|
|
|
optional string media_file_url = 17;
|
|
|
|
optional string init_segment_url = 18;
|
|
|
|
optional string segment_template_url = 19;
|
2018-10-10 22:30:28 +00:00
|
|
|
|
|
|
|
// HLS only. Defines CHARACTERISTICS attribute of the stream.
|
|
|
|
repeated string hls_characteristics = 20;
|
2019-06-13 06:01:16 +00:00
|
|
|
|
|
|
|
// DASH only. Defines Accessibility elements of the stream. It should be in
|
|
|
|
// the format: scheme_id_uri=value.
|
|
|
|
repeated string dash_accessibilities = 21;
|
|
|
|
// DASH only. Defines Role elements of the stream. The value can be a valid
|
|
|
|
// Role value defined in "urn:mpeg:dash:role:2011" scheme or in the format:
|
|
|
|
// scheme_id_uri=value (to be implemented).
|
|
|
|
repeated string dash_roles = 22;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|