All Products
Search
Document Center

ApsaraVideo Media Processing:SubmitMediaInfoJob

Last Updated:Oct 16, 2024

Submits a media information analysis job.

Operation description

  • Before you submit a media information analysis job, make sure that the input file is uploaded to an Object Storage Service (OSS) bucket. Otherwise, the job fails. You can configure upload callbacks to be notified of the upload status of files.****
  • A media information analysis job can be run in synchronous or asynchronous mode.
  • In asynchronous mode, the media information analysis job is submitted to and scheduled in an ApsaraVideo Media Processing (MPS) queue. In this case, the media information analysis job may be queued. The media information analysis job may not be generated when the response to the SubmitMediaInfoJob operation is returned. After the execution is complete, you can call the QueryMediaInfoJobList operation to poll the execution results, or associate a Message Service (MNS) queue or topic with the MPS queue to receive the execution results. For more information, see Receive message notifications.

QPS limits

You can call this operation up to 50 times per second per account. If the number of requests that you send to call this operation within one second reaches the request limit of this operation, new requests fail and you may experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • 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 Key: the condition key that is defined by the cloud service.
  • 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.
OperationAccess levelResource typeCondition keyAssociated operation
mts:SubmitMediaInfoJobcreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InputstringYes

The information about the input media file. The value is a JSON string. You must perform the following operations to add the OSS bucket in which the input media file is stored as a media bucket: Log on to the MPS console, choose Workflows > Media Buckets in the left-side navigation pane, and then click Add Bucket. After you add the OSS bucket as a media bucket, you must perform URL encoding for the OSS object. For example, {"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"} indicates the example-bucket.example-location.aliyuncs.com/example/example.flv file.

Note The OSS bucket must reside in the same region as your MPS service.
{"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"}
UserDatastringNo

The custom data. The custom data can contain letters, digits, and hyphens (-), and can be up to 1,024 bytes in length. The custom data cannot start with a special character.

testid-001
PipelineIdstringNo

The ID of the MPS queue to which the job was submitted. For more information, see Terms .

  • To view the ID of the MPS queue, log on to the MPS console and choose Global Settings > MPS queue and Callback in the left-side navigation pane. On the MPS queue and Callback page, you can view the ID of an MPS queue or create an MPS queue.
  • If you want to receive asynchronous message notifications, associate an MNS queue or topic with the MPS queue. For more information, see Receive message notifications.
88c6ca184c0e432bbf5b665e2a15****
AsyncbooleanNo

Specifies whether to enable the asynchronous mode for the job. We recommend that you set this parameter to true. Valid values:

  • true: enables the asynchronous mode.
  • false: does not enable the asynchronous mode.
true

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

MediaInfoJobobject

The details of the media information analysis job.

CreationTimestring

The time when the job was created.

2014-01-10T12:00:00Z
Statestring

The status of the job. Valid values:

  • Success: The job is successful.
  • Fail: The job fails.
  • Analyzing: The job is being run.
Analyzing
JobIdstring

The ID of the job.

23ca1d184c0e4341e5b665e2a12****
UserDatastring

The custom data.

testid-001
Codestring

The error code returned if the job fails.

InvalidParameter.JsonObjectFormatInvalid
Messagestring

The error message returned if the job fails.

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

The ID of the MPS queue to which the analysis job is submitted.

88c6ca184c0e432bbf5b665e2a15****
Asyncboolean

Indicates whether the job is run in asynchronous mode.

true
Inputobject

The information about the input media file.

Objectstring

The name of the OSS object that is used as the input media file.

example.flv
Locationstring

The region in which the OSS bucket that stores the input media file resides.

example-location
Bucketstring

The name of the OSS bucket in which the input media file is stored.

example-bucket
MNSMessageResultobject

The message sent by Message Service (MNS) to notify users of the job result.

MessageIdstring

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

16f01ad6175e4230ac42bb5182cd****
ErrorMessagestring

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

InvalidParameter.JsonObjectFormatInvalid
ErrorCodestring

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

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

The properties of the input media file.

Widthstring

The width of the video. Unit: pixel.

1920
Heightstring

The height of the video. Unit: pixel.

1080
Durationstring

The duration of the input media file. Unit: seconds.

17.226000
Fpsstring

The frame rate.

25
Bitratestring

The bitrate. Unit: Kbit/s.

1630.045
FileFormatstring

The format of the input media file.

QuickTime/MOV
Streamsobject

The media streams that are contained in the input media file.

VideoStreamListarray<object>

The video streams. A media file can contain up to four video streams.

VideoStreamobject

The response parameters.

Sarstring

The sample aspect ratio (SAR).

1:1
Heightstring

The height of the video. Unit: pixel.

1080
CodecTagStringstring

The tag string of the encoding format.

avc1
NetworkCostobject

The network bandwidth that is consumed.

PreloadTimestring

The time consumed to preload the video.

8
AvgBitratestring

The average bitrate. Unit: Kbit/s.

300.34
CostBandwidthstring

The maximum bandwidth that is consumed.

10
Widthstring

The width of the video. Unit: pixel.

1920
Indexstring

The sequence number of the video stream. The value indicates the position of the video stream in all video streams. The sequence number of the first video stream to be played can be specified in some players. Default value: 1.

1
Timebasestring

The time base.

1/24000
AvgFPSstring

The average frame rate.

23.976025
PixFmtstring

The pixel format.

yuv420p
Langstring

The language.

eng
CodecLongNamestring

The full name of the encoding format.

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

The total number of frames.

100
Rotatestring

The rotation angle of the video.

90
Bitratestring

The bitrate. Unit: Kbit/s.

1496.46
HasBFramesstring

Indicates whether the video stream contains bidirectional frames (B-frames). A value of 1 indicates that the video stream contains B-frames. A value of 0 indicates that the video stream does not contain B-frames.

0
Profilestring

The codec profile.

High
StartTimestring

The start time of the video stream.

0.042000
Darstring

The display aspect ratio (DAR). DAR is the proportional relationship between the width and the height of a video. The value is used to determine whether the video is in portrait mode or landscape mode.

16:9
CodecNamestring

The short name of the encoding format. Valid values:

  • h264
  • h265
  • gif
  • webp
h264
Durationstring

The duration of the video stream. Unit: seconds.

17.225542
Fpsstring

The frame rate.

25
CodecTagstring

The tag of the encoding format.

0x31637661
CodecTimeBasestring

The codec time base.

1001/48000
Levelstring

The codec level.

41
ColorRangestring

The color range.

700
ColorTransferstring

The color channel.

R255 G83 B170
ColorPrimariesstring

The level of color reconstruction.

700
AudioStreamListarray<object>

The audio streams. A media file can contain up to four audio streams.

AudioStreamobject

The response parameters.

Timebasestring

The time base.

1/44100
Indexstring

The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams.

1
SampleFmtstring

The sampling format.

fltp
ChannelLayoutstring

The output layout of the sound channels.

stereo
Langstring

The language.

eng
Sampleratestring

The sampling rate. Unit: Hz.

44100
CodecLongNamestring

The full name of the encoding format.

AAC (Advanced Audio Coding)
Channelsstring

The number of sound channels.

2
NumFramesstring

The total number of frames.

123
Bitratestring

The bitrate. Unit: Kbit/s.

128.806
CodecTagStringstring

The tag string of the encoding format.

mp4a
StartTimestring

The start time of the audio stream.

0.000000
CodecNamestring

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

  • acc
  • mp3
  • mp4
  • ogg
  • flac
aac
Durationstring

The duration of the audio stream. Unit: seconds.

17.159546
CodecTagstring

The tag of the encoding format.

0x6134706d
CodecTimeBasestring

The codec time base.

1/44100
SubtitleStreamListarray<object>

The subtitle streams. A media file can contain up to four subtitle streams.

SubtitleStreamobject

The response parameters.

Timebasestring

The time base.

1/1000
Indexstring

The sequence number of the subtitle stream. The value indicates the position of the subtitle stream in all subtitle streams.

3
StartTimestring

The start time of the subtitle stream.

0.000000
CodecNamestring

The short name of the encoding format. Valid values:

  • srt
  • ass
ass
Langstring

The language.

eng
CodecLongNamestring

The full name of the encoding format.

ASS (Advanced SSA) subtitle
Durationstring

The duration of the audio stream. Unit: seconds.

1370.116000
CodecTagstring

The tag of the encoding format.

0x0000
CodecTimeBasestring

The codec time base.

0/1
CodecTagStringstring

The tag string of the encoding format.

[0][0][0][0]
Formatobject

The format information.

StartTimestring

The start time.

0.000000
NumProgramsstring

The total number of program streams.

0
Sizestring

The size of the file. Unit: bytes.

3509895
NumStreamsstring

The total number of media streams.

2
FormatLongNamestring

The full name of the container format.

QuickTime/MOV
Durationstring

The duration of the input media file. Unit: seconds.

17.226000
Bitratestring

The total bitrate. Unit: Kbit/s.

1630.045
FormatNamestring

The short name of the container format. For more information about the parameters, see Parameter details.

mov
FileSizestring

The size of the file. Unit: bytes.

3509895
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

{
  "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"
            }
          ]
        },
        "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"
            }
          ]
        },
        "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"
      },
      "FileSize": "3509895"
    }
  },
  "RequestId": "62D9BE16-B7D5-550C-A482-7A0F60E09877"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-05-18Add OperationView Change Details