SubmitMediaInfoJob

Updated at:

Submits a media information analysis job. After this operation is called, ApsaraVideo Media Processing (MPS) analyzes the input file and returns its media information.

Operation description

  • Make sure that the file is successfully uploaded to OSS before you submit a media information analysis job. Otherwise, the job fails. You can check the file upload status by configuring OSS callback messages.

  • Media information analysis jobs support synchronous and asynchronous modes.

  • The asynchronous mode does not guarantee timeliness. After a media information analysis job is submitted, the task is added to an MPS queue for scheduling and execution. Therefore, the job may not be generated when the API response is returned. After the execution is complete, you must call the Query media information analysis jobs operation to poll the execution result, or bind an MNS message to the MPS queue to receive the execution result. For more information, see Receive message notifications.

QPS limit

The queries per second (QPS) limit for a single user is 50. If the limit is exceeded, API calls are throttled, which may affect your business. Call this operation properly. For more information, see QPS limits.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mts:SubmitMediaInfoJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Input

string

Yes

The job input. For more information, see Input details.

Note
  • In ApsaraVideo Media Processing API operations, the Object parameter must be URL-encoded based on UTF-8 before it is used.

  • The region of OSS must be the same as the region of MPS.

{"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"}

UserData

string

No

The custom user data. The value can contain letters, digits, and hyphens (-), and cannot start with a special character. The maximum length is 1,024 bytes.

testid-001

PipelineId

string

No

The ID of the MPS queue. For more information, see Terms.

  • Valid values: You can query and create MPS queues by choosing Global Settings > MPS queues in the MPS console.

  • If asynchronous notifications are required, attach an MNS message to the MPS queue. For more information, see Accept message notifications.

88c6ca184c0e432bbf5b665e2a15****

Async

boolean

No

Specifies whether to submit an asynchronous job. Valid values:

  • true: Submits an asynchronous job. This value is recommended.

  • false: Does not submit an asynchronous job.

true

Config

string

No

Response elements

Element

Type

Description

Example

object

The response parameters.

MediaInfoJob

object

The details of the media information analysis job.

CreationTime

string

The time when the job was added. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format.

2014-01-10T12:00:00Z

State

string

The status of the job. Valid values:

  • Success: The job succeeded.

  • Fail: The job failed.

  • Analyzing: The job is being analyzed.

Analyzing

JobId

string

The ID of the media information analysis job.

23ca1d184c0e4341e5b665e2a12****

UserData

string

The custom user data.

testid-001

Code

string

The error code returned when the media information analysis fails.

InvalidParameter.JsonObjectFormatInvalid

Message

string

The error message returned when the media information analysis fails.

The parameter ”*” does not conform to the JSON Object specification

PipelineId

string

The ID of the MPS queue.

88c6ca184c0e432bbf5b665e2a15****

Async

boolean

Indicates whether the job is asynchronous.

true

Input

object

The job input information.

Object

string

The Object Storage Service (OSS) object of the input file.

example.flv

Location

string

The region of the OSS bucket that stores the input file.

example-location

Bucket

string

The OSS bucket that stores the input file.

example-bucket

MNSMessageResult

object

The result of the Message Service (MNS) notification sent to the user upon job completion.

MessageId

string

The ID of the message if the job succeeds. This parameter is not returned if the job fails.

16f01ad6175e4230ac42bb5182cd****

ErrorMessage

string

The error message if the job fails. This parameter is not returned if the job succeeds.

InvalidParameter.JsonObjectFormatInvalid

ErrorCode

string

The error code if the job fails. This parameter is not returned if the job succeeds.

The parameter \"Input\" does not conform to the JSON Object specification

Properties

object

The properties of the media file.

Width

string

The width of the video. Unit: pixels.

1920

Height

string

The height of the video. Unit: pixels.

1080

Duration

string

The total duration. Unit: seconds.

17.226000

Fps

string

The frame rate.

25

Bitrate

string

The bitrate. Unit: Kbps.

1630.045

FileFormat

string

The file format.

QuickTime/MOV

Streams

object

The stream information.

VideoStreamList

object

VideoStream

array<object>

The list of video streams. The list contains up to four elements.

array<object>

The video stream.

Sar

string

The sample aspect ratio.

1:1

Height

string

The height of the video. Unit: pixels.

1080

CodecTagString

string

The encoding format mark text.

avc1

NetworkCost

object

The network bandwidth consumption.

PreloadTime

string

The preload time.

8

AvgBitrate

string

The average bitrate. Unit: Kbps.

300.34

CostBandwidth

string

The maximum consumed bandwidth.

10

Width

string

The width of the video. Unit: pixels.

1920

Index

string

The index of the video stream. This index identifies the position of the video stream in the entire media stream. Some playback platforms allow you to specify the index of the video stream to start playback, while others start playback from index 1 by default.

1

Timebase

string

The time base.

1/24000

AvgFPS

string

The average frame rate.

23.976025

PixFmt

string

The pixel format.

yuv420p

Lang

string

The language.

eng

CodecLongName

string

The long name of the encoding format.

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

NumFrames

string

The total number of frames.

100

Rotate

string

The rotation angle of the video.

90

Bitrate

string

The bitrate. Unit: Kbps.

1496.46

HasBFrames

string

Indicates whether the video contains B-frames. A value of 0 indicates no B-frames. A value of 1 indicates that B-frames are included.

0

Profile

string

The encoding profile.

High

StartTime

string

The start time.

0.042000

Dar

string

The display aspect ratio. The display aspect ratio is calculated by dividing the video width by the video height. You can use this value to determine whether the video is in landscape or portrait orientation.

16:9

CodecName

string

The short name of the encoding format. Valid values:

  • h264

  • h265

  • gif

  • webp

h264

Duration

string

The duration. Unit: seconds.

17.225542

Fps

string

The frame rate.

25

CodecTag

string

The encoding format mark.

0x31637661

CodecTimeBase

string

The codec time base.

1001/48000

Level

string

The encoding level.

41

ColorRange

string

The color range.

700

ColorTransfer

string

The color transfer characteristics.

R255 G83 B170

ColorPrimaries

string

The color primaries.

700

DurationInaccurate

string

DolbyVision

object

Profile

string

Level

string

AudioStreamList

object

AudioStream

array<object>

The list of audio streams. The list contains up to four elements.

object

The video stream.

Timebase

string

The time base.

1/44100

Index

string

The index of the audio stream. This index identifies the position of the audio stream in the entire media stream.

1

SampleFmt

string

The sample format.

fltp

ChannelLayout

string

The channel layout.

stereo

Lang

string

The language.

eng

Samplerate

string

The sampling rate. Unit: Hz.

44100

CodecLongName

string

The long name of the encoding format.

AAC (Advanced Audio Coding)

Channels

string

The number of channels.

2

NumFrames

string

The total number of frames.

123

Bitrate

string

The bitrate. Unit: Kbps.

128.806

CodecTagString

string

The encoding format mark text.

mp4a

StartTime

string

The start time.

0.000000

CodecName

string

The short name of the encoding format. Default value: acc. Valid values:

  • acc

  • mp3

  • mp4

  • ogg

  • flac

aac

Duration

string

The duration. Unit: seconds.

17.159546

CodecTag

string

The encoding format mark.

0x6134706d

CodecTimeBase

string

The codec time base.

1/44100

DurationInaccurate

string

SubtitleStreamList

object

SubtitleStream

array<object>

The list of caption streams. The list contains up to four elements.

object

The video stream.

Timebase

string

The time base.

1/1000

Index

string

The index of the caption stream. This index identifies the position of the caption stream in the entire media stream.

3

StartTime

string

The start time.

0.000000

CodecName

string

The short name of the encoding format. Valid values:

  • srt

  • ass

ass

Lang

string

The language.

eng

CodecLongName

string

The long name of the encoding format.

ASS (Advanced SSA) subtitle

Duration

string

The duration. Unit: seconds.

1370.116000

CodecTag

string

The tag of the encoding format.

0x0000

CodecTimeBase

string

The codec time base.

0/1

CodecTagString

string

The tag string of the encoding format.

[0][0][0][0]

Format

object

The format information.

StartTime

string

The start time.

0.000000

NumPrograms

string

The total number of program streams.

0

Size

string

The size of the file, in bytes.

3509895

NumStreams

string

The total number of media streams.

2

FormatLongName

string

The long name of the container or packaging format.

QuickTime/MOV

Duration

string

The total duration. Unit: seconds.

17.226000

Bitrate

string

The total bitrate, in Kbit/s.

1630.045

FormatName

string

The short name of the container or packaging format. For more information, see Parameter details.

mov

Tags

object

FileSize

string

The size of the file, in bytes.

3509895

MD5

string

RequestId

string

The request ID.

62D9BE16-B7D5-550C-A482-7A0F60E09877

Examples

Success response

JSON format

{
  "MediaInfoJob": {
    "CreationTime": "2014-01-10T12:00:00Z",
    "State": "Analyzing",
    "JobId": "23ca1d184c0e4341e5b665e2a12****",
    "UserData": "testid-001",
    "Code": "InvalidParameter.JsonObjectFormatInvalid",
    "Message": "The parameter ”*” does not conform to the JSON Object specification",
    "PipelineId": "88c6ca184c0e432bbf5b665e2a15****",
    "Async": true,
    "Input": {
      "Object": "example.flv",
      "Location": "example-location",
      "Bucket": "example-bucket"
    },
    "MNSMessageResult": {
      "MessageId": "16f01ad6175e4230ac42bb5182cd****",
      "ErrorMessage": "InvalidParameter.JsonObjectFormatInvalid",
      "ErrorCode": "The parameter \\\"Input\\\" does not conform to the JSON Object specification"
    },
    "Properties": {
      "Width": "1920",
      "Height": "1080",
      "Duration": "17.226000",
      "Fps": "25",
      "Bitrate": "1630.045",
      "FileFormat": "QuickTime/MOV",
      "Streams": {
        "VideoStreamList": {
          "VideoStream": [
            {
              "Sar": "1:1",
              "Height": "1080",
              "CodecTagString": "avc1",
              "NetworkCost": {
                "PreloadTime": "8",
                "AvgBitrate": "300.34",
                "CostBandwidth": "10"
              },
              "Width": "1920",
              "Index": "1",
              "Timebase": "1/24000",
              "AvgFPS": "23.976025",
              "PixFmt": "yuv420p",
              "Lang": "eng",
              "CodecLongName": "H.264/AVC/MPEG-4 AVC/MPEG-4 part 10",
              "NumFrames": "100",
              "Rotate": "90",
              "Bitrate": "1496.46",
              "HasBFrames": "0",
              "Profile": "High",
              "StartTime": "0.042000",
              "Dar": "16:9",
              "CodecName": "h264",
              "Duration": "17.225542",
              "Fps": "25",
              "CodecTag": "0x31637661",
              "CodecTimeBase": "1001/48000",
              "Level": "41",
              "ColorRange": "700",
              "ColorTransfer": "R255 G83 B170",
              "ColorPrimaries": "700",
              "DurationInaccurate": "",
              "DolbyVision": {
                "Profile": "",
                "Level": ""
              }
            }
          ]
        },
        "AudioStreamList": {
          "AudioStream": [
            {
              "Timebase": "1/44100",
              "Index": "1",
              "SampleFmt": "fltp",
              "ChannelLayout": "stereo",
              "Lang": "eng",
              "Samplerate": "44100",
              "CodecLongName": "AAC (Advanced Audio Coding)",
              "Channels": "2",
              "NumFrames": "123",
              "Bitrate": "128.806",
              "CodecTagString": "mp4a",
              "StartTime": "0.000000",
              "CodecName": "aac",
              "Duration": "17.159546",
              "CodecTag": "0x6134706d",
              "CodecTimeBase": "1/44100",
              "DurationInaccurate": ""
            }
          ]
        },
        "SubtitleStreamList": {
          "SubtitleStream": [
            {
              "Timebase": "1/1000",
              "Index": "3",
              "StartTime": "0.000000",
              "CodecName": "ass",
              "Lang": "eng",
              "CodecLongName": "ASS (Advanced SSA) subtitle",
              "Duration": "1370.116000",
              "CodecTag": "0x0000",
              "CodecTimeBase": "0/1",
              "CodecTagString": "[0][0][0][0]"
            }
          ]
        }
      },
      "Format": {
        "StartTime": "0.000000",
        "NumPrograms": "0",
        "Size": "3509895",
        "NumStreams": "2",
        "FormatLongName": "QuickTime/MOV",
        "Duration": "17.226000",
        "Bitrate": "1630.045",
        "FormatName": "mov",
        "Tags": {
          "test": "test",
          "test2": 1
        }
      },
      "FileSize": "3509895",
      "MD5": ""
    }
  },
  "RequestId": "62D9BE16-B7D5-550C-A482-7A0F60E09877"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.