shaka-packager/packager/mpd/base/media_info.proto

208 lines
7.3 KiB
Protocol Buffer
Raw Normal View History

// This file defines the protocol between Muxer and classes for generating MPD
// files.
syntax = "proto2";
package shaka;
message Range {
optional uint64 begin = 1;
optional uint64 end = 2;
}
message MediaInfo {
enum ContainerType {
CONTAINER_UNKNOWN = 0;
CONTAINER_MP4 = 1;
CONTAINER_MPEG2_TS= 2;
CONTAINER_WEBM = 3;
CONTAINER_TEXT = 4;
CONTAINER_PACKED_AUDIO = 5;
}
message VideoInfo {
optional string codec = 1;
// 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.
optional uint32 width = 2;
optional uint32 height = 3;
optional uint32 time_scale = 4;
// Relative to |time_scale|. IOW |time_scale| / |frame_duration| is the
// framerate.
optional uint64 frame_duration = 5;
optional bytes decoder_config = 6;
// 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;
// playback_rate: the playout capability (e.g., 4x, 8x, 16x fast foward) of
// the trick play stream.
optional uint32 playback_rate = 9;
// Transfer characteristics. Useful to determine the VIDEO-RANGE for HLS,
// i.e. whether it is SDR or HDR.
optional uint32 transfer_characteristics = 10;
}
message AudioInfo {
optional string codec = 1;
optional uint32 sampling_frequency = 2;
optional uint32 time_scale = 3;
optional uint32 num_channels = 4;
optional string language = 5;
optional bytes decoder_config = 6;
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.
// 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;
// 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.
// 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;
// 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;
// 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;
}
message TextInfo {
enum TextType {
UNKNOWN = 0;
CAPTION = 1;
SUBTITLE = 2;
}
optional string codec = 1;
optional string language = 2;
optional TextType type = 3;
}
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;
// Specifies the protection scheme: 'cenc', 'cens', 'cbc1', 'cbcs'.
// "cbca" is also valid which is a place holder for SAMPLE-AES encryption.
optional string protection_scheme = 3 [default = 'cenc'];
optional bool include_mspr_pro = 4 [default = true];
}
// 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.
message ContentProtectionXml {
message AttributeNameValuePair {
optional string name = 1;
optional string value = 2;
}
message Element {
optional string name = 1;
repeated AttributeNameValuePair attributes = 2;
repeated Element subelements = 3;
}
// 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>.
optional string scheme_id_uri = 1;
optional string value = 2;
repeated AttributeNameValuePair attributes = 3;
repeated Element subelements = 4;
}
optional uint32 bandwidth = 1;
// 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;
repeated ContentProtectionXml content_protections = 5;
// This is set if the content is protected with a content protection,
// i.e. encrypted.
optional ProtectedContent protected_content = 15;
// This is the reference time scale if there are multiple VideoInfo and/or
// AudioInfo.
optional uint32 reference_time_scale = 13;
optional uint64 presentation_time_offset = 16;
optional ContainerType container_type = 14 [default = CONTAINER_UNKNOWN];
// VOD only.
optional Range init_range = 6;
optional Range index_range = 7;
optional string media_file_name = 8;
repeated Range subsegment_ranges = 23;
// END VOD only.
// VOD and static LIVE.
optional float media_duration_seconds = 9;
// LIVE only.
optional string init_segment_name = 10;
optional string segment_template = 11;
// This value is the user input “segment duration”.
// This value is not necessarily the same as the value passed to
// MpdNotifier::NotifyNewSegment().
optional float segment_duration_seconds = 12 [deprecated = true];
// END LIVE only.
// 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;
// HLS only. Defines CHARACTERISTICS attribute of the stream.
repeated string hls_characteristics = 20;
// 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;
}