输入元数据Input Metadata

媒体服务徽标media services logo


编码作业与要执行部分编码任务的输入资产相关联。An encoding job is associated with an input asset (or assets) on which you want to perform some encoding tasks. 完成任务后,会生成一个输出资产。Upon completion of a task, an output asset is produced. 输出资产包含视频、音频、缩略图、清单等。输出资产还包含提供输入资产相关元数据的文件。The output asset contains video, audio, thumbnails, manifest, etc. The output asset also contains a file with metadata about the input asset. 元数据 XML 文件的名称采用下列格式:<asset_id>_metadata.xml(例如,41114ad3-eb5e-4c57-8d92-5354e2b7d4a4_metadata.xml),其中 <asset_id> 是输入资产的 AssetId 值。The name of the metadata XML file has the following format: <asset_id>_metadata.xml (for example, 41114ad3-eb5e-4c57-8d92-5354e2b7d4a4_metadata.xml), where <asset_id> is the AssetId value of the input asset.

媒体服务不会先扫描输入资产以生成元数据。Media Services does not pre-emptively scan input Assets to generate metadata. 只有在作业中处理输入资产时,才会生成输入元数据。Input metadata is generated only as an artifact when an input Asset is processed in a Job. 因此,此项目会写入到输出资产。Hence this artifact is written to the output Asset. 使用不同的工具为输入资产和输出资产生成元数据。Different tools are used to generate metadata for input Assets and output Assets. 因此,输入元数据的模式与输出元数据略有不同。Therefore, the input metadata has a slightly different schema than the output metadata.

要检查元数据文件,可以创建 SAS 定位器并将文件下载到本地计算机。If you want to examine the metadata file, you can create a SAS locator and download the file to your local computer. 可以就如何创建 SAS 定位器并下载使用媒体服务 .NET SDK 扩展的文件,找到相关示例。You can find an example on how to create a SAS locator and download a file Using the Media Services .NET SDK Extensions.

本文讨论作为输入元数据 (<asset_id>_metadata.xml) 的基础的 XML 架构的元素和类型。This article discusses the elements and types of the XML schema on which the input metada (<asset_id>_metadata.xml) is based. 若要深入了解包含有关输出资产的元数据的文件,请参阅输出元数据For information about the file that contains metadata about the output asset, see Output Metadata.

可以在本文末尾找到架构代码XML 示例You can find the Schema Code an XML example at the end of this article.

AssetFiles 元素(根元素)AssetFiles element (root element)

包含用于编码作业的 AssetFile 元素集合。Contains a collection of AssetFile elements for the encoding job.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

名称Name 说明Description
AssetFile AssetFile

minOccurs="1" maxOccurs="unbounded"minOccurs="1" maxOccurs="unbounded"
单个子元素。A single child element. 有关详细信息,请参阅 AssetFile 元素For more information, see AssetFile element.

AssetFile 元素AssetFile element

包含描述资产文件的属性和元素。Contains attributes and elements that describe an asset file.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

属性Attributes

名称Name 类型Type 说明Description
名称Name

必须Required
xs:stringxs:string 资产文件名称。Asset file name.
大小Size

必须Required
xs:longxs:long 以字节为单位的资产文件大小。Size of the asset file in bytes.
持续时间Duration

必须Required
xs:durationxs:duration 内容播放持续时间。Content play back duration. 示例:Duration="PT25M37.757S"。Example: Duration="PT25M37.757S".
NumberOfStreams NumberOfStreams

必须Required
xs:intxs:int 资产文件中的流数。Number of streams in the asset file.
FormatNames FormatNames

必须Required
xs: stringxs: string 格式名称。Format names.
FormatVerboseNames FormatVerboseNames

必须Required
xs: stringxs: string 格式详细名称。Format verbose names.
StartTimeStartTime xs:durationxs:duration 内容开始时间。Content start time. 示例:StartTime="PT2.669S"。Example: StartTime="PT2.669S".
OverallBitRateOverallBitRate xs: intxs: int 资产文件的平均比特率 (kbps)。Average bitrate of the asset file in kbps.

备注

以下四个子元素必须出现在一个序列中。The following four child elements must appear in a sequence.

子元素Child elements

名称Name 类型Type 说明Description
Programs Programs

minOccurs="0"minOccurs="0"
当资产文件为 MPEG-TS 格式时,所有Programs 元素的集合。Collection of all Programs element when the asset file is in MPEG-TS format.
VideoTracks VideoTracks

minOccurs="0"minOccurs="0"
每个物理资产文件可包含交错成适当容器格式的零个或多个视频轨道。Each physical asset file can contain zero or more videos tracks interleaved into an appropriate container format. 此元素包含属于资产文件一部分的所有 VideoTracks 的集合。This element contains a collection of all VideoTracks that are part of the asset file.
AudioTracks AudioTracks

minOccurs="0"minOccurs="0"
每个物理资产文件可以包含零个或以上交错到相应容器格式的音频轨道。Each physical asset file can contain zero or more audio tracks interleaved into an appropriate container format. 此元素包含属于资产文件一部分的所有 AudioTracks 的集合。This element contains a collection of all AudioTracks that are part of the asset file.
Metadata Metadata

minOccurs="0" maxOccurs="unbounded"minOccurs="0" maxOccurs="unbounded"
MetadataTypeMetadataType 资产文件的元数据表示为键\值字符串。Asset file’s metadata represented as key\value strings. 例如:For example:

<元数据键 ="language" 值="eng" /> <Metadata key="language" value="eng" />

TrackTypeTrackType

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

属性Attributes

名称Name 类型Type 说明Description
Id Id

必须Required
xs:intxs:int 此音频轨或视频轨从零开始的索引。Zero-based index of this audio or video track.

这不一定是 MP4 文件中使用的 TrackID。This is not necessarily that the TrackID as used in an MP4 file.
CodecCodec xs:stringxs:string 视频轨道编解码器字符串。Video track codec string.
CodecLongNameCodecLongName xs: stringxs: string 音频或视频轨道编解码器长名称。Audio or video track codec long name.
TimeBase TimeBase

必须Required
xs:stringxs:string 时间基准。Time base. 示例:TimeBase="1/48000"Example: TimeBase="1/48000"
NumberOfFramesNumberOfFrames xs:intxs:int 帧数(针对视频轨)。Number of frames (present for video tracks).
StartTimeStartTime xs: durationxs: duration 轨道开始时间。Track start time. 示例:StartTime="PT2.669S"Example: StartTime="PT2.669S"
持续时间Duration xs:durationxs:duration 轨道持续时间。Track duration. 示例:Duration="PTSampleFormat M37.757S"。Example: Duration="PTSampleFormat M37.757S".

备注

以下两个子元素必须出现在一个序列中。The following two child elements must appear in a sequence.

子元素Child elements

名称Name 类型Type 说明Description
Disposition Disposition

minOccurs="0" maxOccurs="1"minOccurs="0" maxOccurs="1"
StreamDispositionTypeStreamDispositionType 包含演示信息(例如,特定音频轨是否适用于视觉障碍人士)。Contains presentation information (for example, whether a particular audio track is for visually impaired viewers).
Metadata Metadata

minOccurs="0" maxOccurs="unbounded"minOccurs="0" maxOccurs="unbounded"
MetadataTypeMetadataType 可以用来保存各种信息的通用键/值字符串。Generic key/value strings that can be used to hold a variety of information. 例如,key=”language” 和 value=”eng”。For example, key=”language”, and value=”eng”.

AudioTrackType(继承自 TrackType)AudioTrackType (inherits from TrackType)

AudioTrackType 是继承自 TrackType 的全局复杂类型 。AudioTrackType is a global complex type that inherits from TrackType.

此类型表示资产文件中的特定音频轨道。The type represents a specific audio track in the asset file.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

属性Attributes

名称Name 类型Type 说明Description
SampleFormatSampleFormat xs:stringxs:string 示例格式。Sample format.
ChannelLayoutChannelLayout xs: stringxs: string 通道布局。Channel layout.
通道 Channels

必须Required
xs:intxs:int 音频通道数(0 个或多个)。Number (0 or more) of audio channels.
SamplingRate SamplingRate

必须Required
xs:intxs:int 音频采样率(样本数/秒或 Hz)。Audio sampling rate in samples/sec or Hz.
Bitrate Bitrate xs:intxs:int 由资产文件计算所得的平均音频比特率(比特/秒)。Average audio bit rate in bits per second, as calculated from the asset file. 仅对基本流有效负载计数,此计数中不包含打包开销。Only the elementary stream payload is counted, and the packaging overhead is not included in this count.
BitsPerSampleBitsPerSample xs:intxs:int wFormatTag 格式类型的每个样本位数。Bits per sample for the wFormatTag format type.

VideoTrackType(继承自 TrackType)VideoTrackType (inherits from TrackType)

VideoTrackType 是继承自 TrackType 的全局复杂类型 。VideoTrackType is a global complex type that inherits from TrackType.

此类型表示资产文件中的特定视频轨道。The type represents a specific video track in the asset file.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

属性Attributes

名称Name 类型Type 说明Description
FourCC FourCC

必须Required
xs:stringxs:string 视频编解码器 FourCC 代码。Video codec FourCC code.
ProfileProfile xs: stringxs: string 视频轨道的配置文件。Video track's profile.
级别Level xs: stringxs: string 视频轨道的级别。Video track's level.
PixelFormatPixelFormat xs: stringxs: string 视频轨道的像素格式。Video track's pixel format.
Width Width

必须Required
xs:intxs:int 以像素为单位的编码视频宽度。Encoded video width in pixels.
Height Height

必须Required
xs:intxs:int 以像素为单位的编码视频高度。Encoded video height in pixels.
DisplayAspectRatioNumerator DisplayAspectRatioNumerator

必须Required
xs: doublexs: double 视频显示纵横比分子。Video display aspect ratio numerator.
DisplayAspectRatioDenominator DisplayAspectRatioDenominator

必须Required
xs:doublexs:double 视频显示纵横比分母。Video display aspect ratio denominator.
DisplayAspectRatioDenominator DisplayAspectRatioDenominator

必须Required
xs: doublexs: double 视频样本纵横比分子。Video sample aspect ratio numerator.
SampleAspectRatioNumeratorSampleAspectRatioNumerator xs: doublexs: double 视频样本纵横比分子。Video sample aspect ratio numerator.
SampleAspectRatioNumeratorSampleAspectRatioNumerator xs:doublexs:double 视频样本纵横比分母。Video sample aspect ratio denominator.
FrameRate FrameRate

必须Required
xs:decimalxs:decimal 采用 .3f 格式的测量的视频帧速率。Measured video frame rate in .3f format.
比特率Bitrate xs:intxs:int 由资产文件计算所得的平均视频比特率(千比特/秒)。Average video bit rate in kilobits per second, as calculated from the asset file. 仅针对基本流有效负载计数,不包含打包开销。Only the elementary stream payload is counted, and the packaging overhead is not included.
MaxGOPBitrateMaxGOPBitrate xs: intxs: int 此视频轨道的最大 GOP 平均比特率(千比特/秒)。Max GOP average bitrate for this video track, in kilobits per second.
HasBFramesHasBFrames xs:intxs:int B 帧的视频轨道数。Video track number of B frames.

MetadataTypeMetadataType

MetadataType 是一个全局复杂类型,它将资产文件的元数据描述为键/值字符串。MetadataType is a global complex type that describes metadata of an asset file as key/value strings. 例如,key=”language” 和 value=”eng”。For example, key=”language”, and value=”eng”.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

属性Attributes

名称Name 类型Type 说明Description
key key

必须Required
xs:stringxs:string 键/值对中的键。The key in the key/value pair.
value value

必须Required
xs:stringxs:string 键/值对中的值。The value in the key/value pair.

ProgramTypeProgramType

ProgramType 是描述节目的全局复杂类型。ProgramType is a global complex type that describes a program.

属性Attributes

名称Name 类型Type 说明Description
ProgramId ProgramId

必须Required
xs:intxs:int 节目 IDProgram Id
NumberOfPrograms NumberOfPrograms

必须Required
xs:intxs:int 节目数。Number of programs.
PmtPid PmtPid

必须Required
xs:intxs:int 节目映射表 (PMT) 包含有关节目的信息。Program Map Tables (PMTs) contain information about programs. 有关详细信息,请参阅 PMtFor more information, see PMt.
PcrPid PcrPid

必须Required
xs: intxs: int 由解码器使用。Used by decoder. 有关详细信息,请参阅 PCRFor more information, see PCR
StartPTSStartPTS xs: longxs: long 开始演示时间戳。Starting presentation time stamp.
EndPTSEndPTS xs: longxs: long 结束演示时间戳。Ending presentation time stamp.

StreamDispositionTypeStreamDispositionType

StreamDispositionType 是描述流的全局复杂类型。StreamDispositionType is a global complex type that describes the stream.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

属性Attributes

名称Name 类型Type 说明Description
Default Default

必须Required
xs: intxs: int 将此属性设置为 1,表示这是默认演示。Set this attribute to 1 to indicate this is the default presentation.
Dub Dub

必须Required
xs:intxs:int 将此属性设置为 1,表示这是译制的演示。Set this attribute to 1 to indicate this is the dubbed presentation.
Original Original

必须Required
xs: intxs: int 将此属性设置为 1,表示这是原始演示。Set this attribute to 1 to indicate this is the original presentation.
Comment Comment

必须Required
xs:intxs:int 将此属性设置为 1,表示此轨道包含注释。Set this attribute to 1 to indicate this track contains commentary.
Lyrics Lyrics

必须Required
xs:intxs:int 将此属性设置为 1,表示此轨道包含歌词。Set this attribute to 1 to indicate this track contains lyrics.
Karaoke Karaoke

必须Required
xs:intxs:int 将此属性设置为 1,表示此为卡拉 OK 轨道(仅背景音乐,没有歌唱部分)。Set this attribute to 1 to indicate this represents the karaoke track (background music, no vocals).
Forced Forced

必须Required
xs:intxs:int 将此属性设置为 1,表示这是强制播放的演示。Set this attribute to 1 to indicate this is the forced presentation.
HearingImpaired HearingImpaired

必须Required
xs:intxs:int 将此属性设置为 1,表示此轨道针对听觉障碍人士。Set this attribute to 1 to indicate this track is for people who are hard of hearing.
VisualImpaired VisualImpaired

必须Required
xs:intxs:int 将此属性设置为 1,表示此轨道针对视觉障碍人士。Set this attribute to 1 to indicate this track is for the visually impaired.
CleanEffects CleanEffects

必须Required
xs: intxs: int 将此属性设置为 1,表示此轨道具有清晰效果。Set this attribute to 1 to indicate this track has clean effects.
AttachedPic AttachedPic

必须Required
xs: intxs: int 将此属性设置为 1,表示此轨道包含图片。Set this attribute to 1 to indicate this track has pictures.

Programs 元素Programs element

包含多个 Program 元素的包装器元素。Wrapper element holding multiple Program elements.

子元素Child elements

名称Name 类型Type 说明Description
Program Program

minOccurs="0" maxOccurs="unbounded"minOccurs="0" maxOccurs="unbounded"
ProgramTypeProgramType 用于 MPEG-TS 格式的资产文件,包含资产文件中节目的相关信息。For asset files that are in MPEG-TS format, contains information about programs in the asset file.

VideoTracks 元素VideoTracks element

具有多个 VideoTrack 元素的包装器元素。Wrapper element holding multiple VideoTrack elements.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

子元素Child elements

名称Name 类型Type 说明Description
VideoTrackVideoTrack

minOccurs="0" maxOccurs="unbounded"minOccurs="0" maxOccurs="unbounded"
VideoTrackType(继承自 TrackType)VideoTrackType (inherits from TrackType) 包含资产文件中视频轨道的相关信息。Contains information about video tracks in the asset file.

AudioTracks 元素AudioTracks element

具有多个 AudioTrack 元素的包装器元素。Wrapper element holding multiple AudioTrack elements.

请参阅本文末尾处的 XML 示例:XML 示例See an XML example at the end of this article: XML example.

元素elements

名称Name 类型Type 说明Description
AudioTrackAudioTrack

minOccurs="0" maxOccurs="unbounded"minOccurs="0" maxOccurs="unbounded"
AudioTrackType(继承自 TrackType)AudioTrackType (inherits from TrackType) 包含有关资产文件中音频轨道的信息。Contains information about audio tracks in the asset file.

架构代码Schema Code

<?xml version="1.0" encoding="utf-8"?>  
<xs:schema xmlns:xs="https://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" version="1.0"  
            xmlns="http://schemas.microsoft.com/windowsazure/mediaservices/2014/07/mediaencoder/inputmetadata"  
            targetNamespace="http://schemas.microsoft.com/windowsazure/mediaservices/2014/07/mediaencoder/inputmetadata"  
            elementFormDefault="qualified">  

  <xs:complexType name="MetadataType">  
    <xs:attribute name="key"   type="xs:string" use="required"/>  
    <xs:attribute name="value" type="xs:string" use="required"/>  
  </xs:complexType>  

  <xs:complexType name="ProgramType">  
    <xs:attribute name="ProgramId" type="xs:int" use="required">  
      <xs:annotation>  
        <xs:documentation>Program Id</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="NumberOfPrograms" type="xs:int" use="required">  
      <xs:annotation>  
        <xs:documentation>Number of programs</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="PmtPid" type="xs:int" use="required">  
      <xs:annotation>  
        <xs:documentation>pmt pid</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="PcrPid" type="xs:int" use="required">  
      <xs:annotation>  
        <xs:documentation>pcr pid</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="StartPTS" type="xs:long">  
      <xs:annotation>  
        <xs:documentation>start pts</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="EndPTS" type="xs:long">  
      <xs:annotation>  
        <xs:documentation>end pts</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
  </xs:complexType>  

  <xs:complexType name="StreamDispositionType">  
    <xs:attribute name="Default"          type="xs:int" use="required" />  
    <xs:attribute name="Dub"              type="xs:int" use="required" />  
    <xs:attribute name="Original"         type="xs:int" use="required" />  
    <xs:attribute name="Comment"          type="xs:int" use="required" />  
    <xs:attribute name="Lyrics"           type="xs:int" use="required" />  
    <xs:attribute name="Karaoke"          type="xs:int" use="required" />  
    <xs:attribute name="Forced"           type="xs:int" use="required" />  
    <xs:attribute name="HearingImpaired"  type="xs:int" use="required" />  
    <xs:attribute name="VisualImpaired"   type="xs:int" use="required" />  
    <xs:attribute name="CleanEffects"     type="xs:int" use="required" />  
    <xs:attribute name="AttachedPic"      type="xs:int" use="required" />  
  </xs:complexType>  

  <xs:complexType name="TrackType" abstract="true">  
    <xs:sequence>  
      <xs:element name="Disposition" type="StreamDispositionType" minOccurs="0" maxOccurs="1"/>  
      <xs:element name="Metadata" type="MetadataType" minOccurs="0" maxOccurs="unbounded"/>  
    </xs:sequence>  
    <xs:attribute name="Id" use="required">  
      <xs:annotation>  
        <xs:documentation>zero-based index of this video track. Note: this is not necessarily the TrackID as used in an MP4 file</xs:documentation>  
      </xs:annotation>  
      <xs:simpleType>  
        <xs:restriction base="xs:int">  
          <xs:minInclusive value="0"/>  
        </xs:restriction>  
      </xs:simpleType>  
    </xs:attribute>  
    <xs:attribute name="Codec" type="xs:string">  
      <xs:annotation>  
        <xs:documentation>video track codec string</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="CodecLongName" type="xs:string">  
      <xs:annotation>  
        <xs:documentation>video track codec long name</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="TimeBase"  type="xs:string" use="required">  
      <xs:annotation>  
        <xs:documentation>Time base. Example: TimeBase="1/48000"</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="NumberOfFrames">  
      <xs:annotation>  
        <xs:documentation>number of frames</xs:documentation>  
      </xs:annotation>  
      <xs:simpleType>  
        <xs:restriction base="xs:int">  
          <xs:minInclusive value="0"/>  
        </xs:restriction>  
      </xs:simpleType>  
    </xs:attribute>  
    <xs:attribute name="StartTime" type="xs:duration">  
      <xs:annotation>  
        <xs:documentation>Track start time. Example: StartTime="PT2.669S"</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
    <xs:attribute name="Duration" type="xs:duration">  
      <xs:annotation>  
        <xs:documentation>Track duration. Example: Duration="PT25M37.757S"</xs:documentation>  
      </xs:annotation>  
    </xs:attribute>  
  </xs:complexType>  

  <xs:complexType name="VideoTrackType">  
    <xs:annotation>  
      <xs:documentation>A specific video track in the parent AssetFile</xs:documentation>  
    </xs:annotation>  
    <xs:complexContent>  
      <xs:extension base="TrackType">  
        <xs:attribute name="FourCC" type="xs:string" use="required">  
          <xs:annotation>  
            <xs:documentation>video codec FourCC code</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
        <xs:attribute name="Profile" type="xs:string">  
          <xs:annotation>  
            <xs:documentation>profile</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
        <xs:attribute name="Level" type="xs:string">  
          <xs:annotation>  
            <xs:documentation>level</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
        <xs:attribute name="PixelFormat" type="xs:string">  
          <xs:annotation>  
            <xs:documentation>Video track's pixel format</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
        <xs:attribute name="Width" use="required">  
          <xs:annotation>  
            <xs:documentation>encoded video width in pixels</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="Height" use="required">  
          <xs:annotation>  
            <xs:documentation>encoded video height in pixels</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="DisplayAspectRatioNumerator" use="required">  
          <xs:annotation>  
            <xs:documentation>video display aspect ratio numerator</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:double">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="DisplayAspectRatioDenominator" use="required">  
          <xs:annotation>  
            <xs:documentation>video display aspect ratio denominator</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:double">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="SampleAspectRatioNumerator">  
          <xs:annotation>  
            <xs:documentation>video sample aspect ratio numerator</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:double">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="SampleAspectRatioDenominator">  
          <xs:annotation>  
            <xs:documentation>video sample aspect ratio denominator</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:double">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="FrameRate" use="required">  
          <xs:annotation>  
            <xs:documentation>measured video frame rate in .3f format</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:decimal">  
              <xs:minInclusive value="0"/>  
              <xs:fractionDigits value="3"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="Bitrate">  
          <xs:annotation>  
            <xs:documentation>average video bit rate in kilobits per second, as calculated from the AssetFile. Counts only the elementary stream payload, and does not include the packaging overhead</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="MaxGOPBitrate">  
          <xs:annotation>  
            <xs:documentation>Max GOP average bitrate for this video track, in kilobits per second</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="HasBFrames" type="xs:int">  
          <xs:annotation>  
            <xs:documentation>video track number of B frames</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
      </xs:extension>  
    </xs:complexContent>  
  </xs:complexType>  

  <xs:complexType name="AudioTrackType">  
    <xs:annotation>  
      <xs:documentation>a specific audio track in the parent AssetFile</xs:documentation>  
    </xs:annotation>  
    <xs:complexContent>  
      <xs:extension base="TrackType">  
        <xs:attribute name="SampleFormat"  type="xs:string">  
          <xs:annotation>  
            <xs:documentation>sample format</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
        <xs:attribute name="ChannelLayout"  type="xs:string">  
          <xs:annotation>  
            <xs:documentation>channel layout</xs:documentation>  
          </xs:annotation>  
        </xs:attribute>  
        <xs:attribute name="Channels" use="required">  
          <xs:annotation>  
            <xs:documentation>number of audio channels</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="SamplingRate" use="required">  
          <xs:annotation>  
            <xs:documentation>audio sampling rate in samples/sec or Hz</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="Bitrate">  
          <xs:annotation>  
            <xs:documentation>average audio bit rate in bits per second, as calculated from the AssetFile. Counts only the elementary stream payload, and does not include the packaging overhead</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
        <xs:attribute name="BitsPerSample">  
          <xs:annotation>  
            <xs:documentation>Bits per sample for the wFormatTag format type</xs:documentation>  
          </xs:annotation>  
          <xs:simpleType>  
            <xs:restriction base="xs:int">  
              <xs:minInclusive value="0"/>  
            </xs:restriction>  
          </xs:simpleType>  
        </xs:attribute>  
      </xs:extension>  
    </xs:complexContent>  
  </xs:complexType>  

  <xs:element name="AssetFiles">  
    <xs:annotation>  
      <xs:documentation>Collection of AssetFile entries for the encoding job</xs:documentation>  
    </xs:annotation>  
    <xs:complexType>  
      <xs:sequence>  
        <xs:element name="AssetFile" minOccurs="1" maxOccurs="unbounded">  
          <xs:annotation>  
            <xs:documentation>asset file</xs:documentation>  
          </xs:annotation>  
          <xs:complexType>  
            <xs:sequence>  
              <xs:element name="Programs" minOccurs="0">  
                <xs:annotation>  
                  <xs:documentation>This is the collection of all programs when file is MPEG-TS</xs:documentation>  
                </xs:annotation>  
                <xs:complexType>  
                  <xs:sequence>  
                    <xs:element name="Program" type="ProgramType" minOccurs="0" maxOccurs="unbounded" />  
                  </xs:sequence>  
                </xs:complexType>  
              </xs:element>  
              <xs:element name="VideoTracks" minOccurs="0">  
                <xs:annotation>  
                  <xs:documentation>Each physical AssetFile can contain in it zero or more video tracks interleaved into an appropriate container format. This is the collection of all those video tracks</xs:documentation>  
                </xs:annotation>  
                <xs:complexType>  
                  <xs:sequence>  
                    <xs:element name="VideoTrack" type="VideoTrackType" minOccurs="0" maxOccurs="unbounded" />  
                  </xs:sequence>  
                </xs:complexType>  
              </xs:element>  
              <xs:element name="AudioTracks" minOccurs="0">  
                <xs:annotation>  
                  <xs:documentation>each physical AssetFile can contain in it zero or more audio tracks interleaved into an appropriate container format. This is the collection of all those audio tracks</xs:documentation>  
                </xs:annotation>  
                <xs:complexType>  
                  <xs:sequence>  
                    <xs:element name="AudioTrack" type="AudioTrackType" minOccurs="0" maxOccurs="unbounded" />  
                  </xs:sequence>  
                </xs:complexType>  
              </xs:element>  
              <xs:element name="Metadata" type="MetadataType" minOccurs="0" maxOccurs="unbounded" />  
            </xs:sequence>  
            <xs:attribute name="Name" type="xs:string" use="required">  
              <xs:annotation>  
                <xs:documentation>the media asset file name</xs:documentation>  
              </xs:annotation>  
            </xs:attribute>  
            <xs:attribute name="Size" use="required">  
              <xs:annotation>  
                <xs:documentation>size of file in bytes</xs:documentation>  
              </xs:annotation>  
              <xs:simpleType>  
                <xs:restriction base="xs:long">  
                  <xs:minInclusive value="0"/>  
                </xs:restriction>  
              </xs:simpleType>  
            </xs:attribute>  
            <xs:attribute name="Duration" type="xs:duration" use="required">  
              <xs:annotation>  
                <xs:documentation>content play back duration. Example: Duration="PT25M37.757S"</xs:documentation>  
              </xs:annotation>  
            </xs:attribute>  
            <xs:attribute name="NumberOfStreams" type="xs:int" use="required">  
              <xs:annotation>  
                <xs:documentation>number of streams in asset file</xs:documentation>  
              </xs:annotation>  
            </xs:attribute>  
            <xs:attribute name="FormatNames" type="xs:string" use="required">  
              <xs:annotation>  
                <xs:documentation>format names</xs:documentation>  
              </xs:annotation>  
            </xs:attribute>  
            <xs:attribute name="FormatVerboseName" type="xs:string" use="required">  
              <xs:annotation>  
                <xs:documentation>format verbose names</xs:documentation>  
              </xs:annotation>  
            </xs:attribute>  
            <xs:attribute name="StartTime" type="xs:duration">  
              <xs:annotation>  
                <xs:documentation>content start time. Example: StartTime="PT2.669S"</xs:documentation>  
              </xs:annotation>  
            </xs:attribute>  
            <xs:attribute name="OverallBitRate">  
              <xs:annotation>  
                <xs:documentation>average bitrate of the asset file in kbps</xs:documentation>  
              </xs:annotation>  
              <xs:simpleType>  
                <xs:restriction base="xs:int">  
                  <xs:minInclusive value="0"/>  
                </xs:restriction>  
              </xs:simpleType>  
            </xs:attribute>  
          </xs:complexType>  
        </xs:element>  
      </xs:sequence>  
    </xs:complexType>  
  </xs:element>  
</xs:schema>  

XML 示例XML example

下面是输入元数据文件的示例。The following is an example of the Input metadata file.

<?xml version="1.0" encoding="utf-8"?>  
<AssetFiles xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/windowsazure/mediaservices/2014/07/mediaencoder/inputmetadata">  
  <AssetFile Name="bear.mp4" Size="1973733" Duration="PT12.678S" NumberOfStreams="2" FormatNames="mov,mp4,m4a,3gp,3g2,mj2" FormatVerboseName="QuickTime / MOV" StartTime="PT0S" OverallBitRate="1245">  
    <VideoTracks>  
      <VideoTrack Id="1" Codec="h264" CodecLongName="H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" TimeBase="1/29970" NumberOfFrames="375" StartTime="PT0.034S" Duration="PT12.645S" FourCC="avc1" Profile="High" Level="4.1" PixelFormat="yuv420p" Width="512" Height="384" DisplayAspectRatioNumerator="4" DisplayAspectRatioDenominator="3" SampleAspectRatioNumerator="1" SampleAspectRatioDenominator="1" FrameRate="29.656" Bitrate="1043" HasBFrames="1">  
        <Disposition Default="1" Dub="0" Original="0" Comment="0" Lyrics="0" Karaoke="0" Forced="0" HearingImpaired="0" VisualImpaired="0" CleanEffects="0" AttachedPic="0" />  
        <Metadata key="creation_time" value="2010-03-10 16:11:56" />  
        <Metadata key="language" value="eng" />  
        <Metadata key="handler_name" value="Mainconcept MP4 Video Media Handler" />  
      </VideoTrack>  
    </VideoTracks>  
    <AudioTracks>  
      <AudioTrack Id="0" Codec="aac" CodecLongName="AAC (Advanced Audio Coding)" TimeBase="1/44100" NumberOfFrames="546" StartTime="PT0S" Duration="PT12.678S" SampleFormat="fltp" ChannelLayout="stereo" Channels="2" SamplingRate="44100" Bitrate="156" BitsPerSample="0">  
        <Disposition Default="1" Dub="0" Original="0" Comment="0" Lyrics="0" Karaoke="0" Forced="0" HearingImpaired="0" VisualImpaired="0" CleanEffects="0" AttachedPic="0" />  
        <Metadata key="creation_time" value="2010-03-10 16:11:56" />  
        <Metadata key="language" value="eng" />  
        <Metadata key="handler_name" value="Mainconcept MP4 Sound Media Handler" />  
      </AudioTrack>  
    </AudioTracks>  
    <Metadata key="major_brand" value="mp42" />  
    <Metadata key="minor_version" value="0" />  
    <Metadata key="compatible_brands" value="mp42mp41" />  
    <Metadata key="creation_time" value="2010-03-10 16:11:53" />  
    <Metadata key="comment" value="Courtesy of National Geographic.  Used by Permission." />  
  </AssetFile>  
</AssetFiles>  

后续步骤Next steps

媒体服务 v3(最新版本)Media Services v3 (latest)

查看最新版本的 Azure 媒体服务!Check out the latest version of Azure Media Services!

媒体服务 v2(旧版)Media Services v2 (legacy)