All Products
Search
Document Center

ApsaraVideo VOD:GetMezzanineInfo

Last Updated:Feb 08, 2023

Queries the information about the mezzanine file of an audio or video. The information includes the mezzanine file URL, resolution, and bitrate of the audio or video.

Operation Description

NoteYou can obtain the complete mezzanine file information only after a stream is transcoded.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All resources is used in the Resource type column of the operation.
  • Condition keyword: refers to the condition keyword defined by the cloud product itself.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operateaccess levelResource typeconditional keywordAssociation operation
vod:GetMezzanineInfoRead
  • VOD
    acs:vod:*:{#accountId}:*/*
    without
without

Request parameters

ParameterTypeRequiredDescriptionExample
VideoIdstringYes

The ID of the video.

1f1a6fc03ca04814031b8a6559e****
AuthTimeoutlongNo

The validity period of the mezzanine file URL. Unit: seconds. Default value: 1800. Minimum value: 1.

  • If the OutputType parameter is set to cdn:

    • The mezzanine file URL has a validity period only if URL signing is enabled. Otherwise, the mezzanine file URL is permanently valid.
    • Minimum value: 1.
    • Maximum Value: unlimited.
    • Default value: If you do not set this parameter, the default validity period that is specified in URL signing is used.
  • If the OutputType parameter is set to oss:

    • The mezzanine file URL has a validity period only if the permissions on the Object Storage Service (OSS) bucket are private. Otherwise, the mezzanine file URL is permanently valid.
    • Minimum value: 1.
    • Maximum value: 2592000 (30 days). The maximum value is limited to reduce security risks of the origin.
    • Default value: If you do not set this parameter, the default value is 3600.
3600
OutputTypestringNo

The type of the mezzanine file URL. Valid values:

  • oss: OSS URL
  • cdn (default): Content Delivery Network (CDN) URL
NoteIf the mezzanine file is stored in a bucket of the in type, only an OSS URL is returned.
oss
AdditionTypestringNo

The type of additional information. Separate multiple values with commas (,). By default, only the basic information is returned. Valid values:

  • video: video stream information
  • audio: audio stream information
video

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

RequestIdstring

The ID of the request.

25818875-5F78-4AF6-D7393642CA58****
Mezzanineobject

The information about the mezzanine file.

CreationTimestring

The time when the file was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-11-14T09:15:50Z
Statusstring

The status of the file. Valid values:

  • Uploading: The file is being uploaded. This is the initial status.
  • Normal: The file is uploaded.
  • UploadFail: The file fails to be uploaded.
  • Deleted: The file is deleted.
Normal
FileURLstring

The URL of the file.

http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/27ffc438-164h67f57ef-0005-6884-51a-1****.mp4
VideoIdstring

The ID of the video.

1f1a6fc03ca04814031b8a6559e****
Heightlong

The height of the file. Unit: pixel.

540
Bitratestring

The bitrate of the file. Unit: Kbit/s.

771.2280
FileNamestring

The name of the file.

27ffc438-164h67f57ef-0005-6884-51a-1****.mp4
OutputTypestring

The type of the mezzanine file URL. Valid values:

  • oss: OSS URL
  • cdn (default): CDN URL
NoteIf you specify an OSS URL for the video stream, the video stream must be in the MP4 format.
oss
Widthlong

The width of the file. Unit: pixel.

960
Sizelong

The size of the file. Unit: byte.

4096477
Durationstring

The duration of the file. Unit: seconds.

42.4930
Fpsstring

The frame rate of the file. Unit: frames per second.

25.0000
AudioStreamListarray

The information about the audio stream.

object

The information about the audio stream.

Indexstring

The sequence number of the audio stream, which specifies the position of the audio stream in all audio streams.

0
Timebasestring

The time base.

0.000000
SampleFmtstring

The sampling format.

fltp
SampleRatestring

The sample rate.

44100
ChannelLayoutstring

The output layout of the sound channels. Valid values:

  • mono: mono sound channel
  • stereo: two sound channels
mono
Langstring

The language.

und
CodecLongNamestring

The full name of the codec format.

AAC (Advanced Audio Coding)
Channelsstring

The number of sound channels.

1
NumFramesstring

The total number of frames.

1
Bitratestring

The bitrate.

62.885
CodecTagStringstring

The tag string of the codec format.

mp4a
StartTimestring

The beginning of the time range that was queried. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-01-11T12:00:00Z
CodecNamestring

The short name of the codec format.

aac
Durationstring

The duration of the audio stream.

3.227574
CodecTagstring

The tag of the codec format.

0x6134706d
CodecTimeBasestring

The codec time base.

1/44100
VideoStreamListarray

The information about the video stream.

object

The information about the video stream.

Timebasestring

The time base.

0.000000
Indexstring

The sequence number of the video stream, which indicates the position of the video stream in all video streams.

1
AvgFPSstring

The average frame rate.

30.0
PixFmtstring

The pixel format.

yuv420p
Langstring

The language.

und
Sarstring

The sample aspect ratio.

0:1
Heightstring

The height of the video resolution.

320
CodecLongNamestring

The full name of the codec format.

H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
NumFramesstring

The total number of frames.

0
Bitratestring

The bitrate of the file. Unit: Kbit/s.

500
Rotatestring

The rotation angle of the video. Valid values: [0, 360).

90
CodecTagStringstring

The tag string of the codec format.

avc1
HasBFramesstring

Indicates whether the video stream contains bidirectional frames (B-frames).

0
Profilestring

The codec profile.

Main
StartTimestring

The beginning of the time range that was queried. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-01-11T12:00:00Z
Darstring

The display aspect ratio.

0:1
CodecNamestring

The short name of the codec format.

h264
Widthstring

The width of the video resolution.

568
Durationstring

The duration of the video stream.

3.166667
Fpsstring

The target frame rate.

30.0
CodecTagstring

The tag of the codec format.

0x31637661
CodecTimeBasestring

The codec time base.

1/60
Levelstring

The codec level.

30
HDRTypestring

The HDR type.

HDR

Example

Normal return example

JSONFormat

{
  "RequestId": "25818875-5F78-4AF6-D7393642CA58****",
  "Mezzanine": {
    "CreationTime": "2017-11-14T09:15:50Z",
    "Status": "Normal",
    "FileURL": "http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/27ffc438-164h67f57ef-0005-6884-51a-1****.mp4",
    "VideoId": "1f1a6fc03ca04814031b8a6559e****",
    "Height": 540,
    "Bitrate": "771.2280",
    "FileName": "27ffc438-164h67f57ef-0005-6884-51a-1****.mp4",
    "OutputType": "oss",
    "Width": 960,
    "Size": 4096477,
    "Duration": "42.4930",
    "Fps": "25.0000",
    "AudioStreamList": [
      {
        "Index": "0",
        "Timebase": "0.000000",
        "SampleFmt": "fltp",
        "SampleRate": "44100",
        "ChannelLayout": "mono",
        "Lang": "und",
        "CodecLongName": "AAC (Advanced Audio Coding)",
        "Channels": "1",
        "NumFrames": "1",
        "Bitrate": "62.885",
        "CodecTagString": "mp4a",
        "StartTime": "2017-01-11T12:00:00Z",
        "CodecName": "aac",
        "Duration": "3.227574",
        "CodecTag": "0x6134706d",
        "CodecTimeBase": "1/44100"
      }
    ],
    "VideoStreamList": [
      {
        "Timebase": "0.000000",
        "Index": "1",
        "AvgFPS": "30.0",
        "PixFmt": "yuv420p",
        "Lang": "und",
        "Sar": "0:1",
        "Height": "320",
        "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
        "NumFrames": "0",
        "Bitrate": "500",
        "Rotate": "90",
        "CodecTagString": "avc1",
        "HasBFrames": "0",
        "Profile": "Main",
        "StartTime": "2017-01-11T12:00:00Z",
        "Dar": "0:1",
        "CodecName": "h264",
        "Width": "568",
        "Duration": "3.166667",
        "Fps": "30.0",
        "CodecTag": "0x31637661",
        "CodecTimeBase": "1/60",
        "Level": "30",
        "HDRType": "HDR"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the API error center.

Change history

Change timeSummary of changesOperate
2021-11-16The response structure of the API operation has changed
Change itemChange content
Output ParametersThe response structure of the API operation has changed

Common errors

The following table describes the common errors that this operation can return.

Error codeError messageHTTP status codeDescription
InvalidVideo.NotFoundThe video does not exist.404The error message returned because the specified video ID does not exist.
InvalidFile.NotFoundThe file does not exist.404The error message returned because the specified video mezzanine file does not exist.