All Products
Search
Document Center

ApsaraVideo Media Processing:SubmitAnalysisJob

Last Updated:Aug 28, 2026

Submits a preset template analysis job.

Operation description

  • After you call this operation, ApsaraVideo Media Processing (MPS) intelligently analyzes the input file and recommends a suitable preset template. You can call the QueryAnalysisJobList operation to query the analysis result or enable asynchronous notifications to receive it.

  • The analysis result is retained for only two weeks after it is generated. If you use the recommended preset template in a transcoding job after two weeks, the job fails and the AnalysisResultNotFound error code is returned.

QPS limit

You can call this operation up to 100 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. For more information, see QPS limit.

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:SubmitAnalysisJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Input

string

Yes

The job input, specified as a JSON object. You must grant MPS read permissions on the specified OSS bucket in the Object Storage Service (OSS) console. For more information, see the "Input" section of the Parameter details topic.

Note

The OSS bucket must reside in the same region as your MPS service.

{"Bucket":"example-bucket","Location":"oss-cn-hangzhou","Object":"example.flv"}

AnalysisConfig

string

No

The job configurations. For more information, see the "AnalysisConfig" section of the Parameter details topic.

{"QualityControl":{"RateQuality":25,"MethodStreaming":"network"}}

UserData

string

No

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

testid-001

PipelineId

string

Yes

The ID of the MPS queue to which the job is submitted. To view the ID of the MPS queue, log on to the MPS console and choose Global Settings > Pipelines in the left-side navigation pane. If you want to enable asynchronous notifications, make sure that the MPS queue is bound to a Message Service (MNS) topic.

bb558c1cc25b45309aab5be44d19****

Priority

string

No

The priority of the job in the MPS queue to which the job is submitted.

  • Valid values: 1 to 10. A value of 10 indicates the highest priority.

  • Default value: 6.

10

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request.

B52658D4-07AB-43CD-82B0-210958A65E23

AnalysisJob

object

The information about the preset template analysis job that was submitted.

CreationTime

string

The time when the job was created.

2014-01-10T12:00:00Z

Percent

integer

The transcoding progress.

100

State

string

The status of the job. Valid values:

  • Submitted: The job is submitted.

  • Analyzing: The job is being run.

  • Success: The job is successful.

  • Fail: The job fails.

Success

AnalysisConfig

object

The job configurations.

QualityControl

object

The quality control on the job output.

MethodStreaming

string

The playback mode. Valid values:

  • network: online playback

  • local: playback on local devices

  • Default value: network.

network

RateQuality

string

The quality level of the output file.

50

PropertiesControl

object

The control on the attributes of the job output.

Deinterlace

string

Indicates whether deinterlacing was forced to run. Valid values:

  • Auto: Deinterlacing was automatically run.

  • Force: Deinterlacing was forced to run.

  • None: Deinterlacing was forced not to run.

Force

Crop

object

The cropping configurations of video images.

Top

string

The top margin that was cropped out.

Note

This parameter is invalid if the Mode parameter is set to Auto or None.

8

Width

string

The width of the video after the margins were cropped out.

Note

This parameter is invalid if the Mode parameter is set to Auto or None.

8

Height

string

The height of the video after the margins were cropped out.

Note

This parameter is invalid if the Mode parameter is set to Auto or None.

8

Left

string

The left margin that was cropped out.

Note

This parameter is invalid if the Mode parameter is set to Auto or None.

8

Mode

string

The cropping mode. Valid values:

  • Auto: Cropping was automatically run. This is the default value.

  • Force: Cropping was forced to run.

  • None: Cropping was forced not to run.

Auto

Message

string

The error message returned if the job failed.

The resource operated \"PipelineId\" cannot be found

Priority

string

The priority of the job in the MPS queue to which the job was submitted.

  • Valid values: 1 to 10. A value of 10 indicates the highest priority.

  • Default value: 10.

10

MNSMessageResult

object

The message sent by MNS to notify users of the job result.

MessageId

string

The ID of the message returned if the job was successful. This parameter is not returned if the job failed.

3ca84a39a9024f19853b21be9cf9****

ErrorMessage

string

The error message returned if the job failed. This parameter is not returned if the job was successful.

The resource operated \"PipelineId\" cannot be found

ErrorCode

string

The error code returned if the job failed. This parameter is not returned if the job was successful.

InvalidParameter.ResourceNotFound

TemplateList

object

Template

array<object>

The matched preset templates.

array<object>

The information about the preset template.

Video

object

The video codec configurations.

Bufsize

string

The size of the buffer.

  • Unit: KB.

  • Default value: 6000.

5000

Degrain

string

The strength of the independent noise reduction algorithm.

5

BitrateBnd

object

The average bitrate range of the video.

Max

string

The upper limit of the total bitrate. Unit: Kbit/s.

20

Min

string

The lower limit of the total bitrate. Unit: Kbit/s.

10

PixFmt

string

The pixel format for video color encoding. Valid values: standard pixel formats such as yuv420p and yuvj420p.

yuvj420p

Codec

string

The video codec. Default value: H.264.

H.264

Height

string

The height of the video.

  • Unit: pixel.

  • Default value: the height of the input video.

1880

Qscale

string

The level of quality control on the video.

15

Bitrate

string

The average bitrate of the video. Unit: Kbit/s.

10

Maxrate

string

The maximum bitrate of the video. Unit: Kbit/s.

10

Profile

string

The codec profile. Valid values:

  • baseline: applicable to mobile devices.

  • main: applicable to standard-definition devices.

  • high: applicable to high-definition devices.

  • Default value: high.

baseline

Crf

string

The constant rate factor.

  • Default value if the Codec parameter is set to H.264: 23. Default value if the Codec parameter is set to H.265: 26.

  • If this parameter is returned, the setting of the Bitrate parameter is invalid.

27

Gop

string

The maximum number of frames between two keyframes. Default value: 250.

1

Width

string

The width of the video.

  • Unit: pixel.

  • Default value: the width of the input video.

1990

Fps

string

The frame rate.

  • The value is 60 if the frame rate of the input video exceeds 60.

  • Default value: the frame rate of the input video.

60

Preset

string

The preset video algorithm. Valid values: veryfast, fast, medium, slow, and slower. Default value: medium.

medium

ScanMode

string

The scan mode. Valid values:

  • interlaced

  • progressive

progressive

TransConfig

object

The general transcoding configurations.

TransMode

string

The transcoding mode. Valid values: onepass, twopass, and CBR. Default value: onepass.

onepass

State

string

The status of the template.

  • Normal: The template is normal.

  • Deleted: The template is deleted.

Normal

MuxConfig

object

The transmuxing configurations.

Gif

object

The transmuxing configurations for the GIF format.

FinalDelay

string

The interval between two consecutive loops for the GIF format. Unit: 0.01s. For example, a value of 500 indicates 5 seconds.

0

Loop

string

The number of loops for the GIF or WebP format. Default value: 0.

0

Segment

object

The segment configurations.

Duration

string

The length of the segment. Unit: seconds.

60

Name

string

The name of the template.

FLV-UD

Audio

object

The audio codec configurations.

Profile

string

The codec profile of the audio. Valid values if the Codec parameter is set to aac: aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld.

aac_low

Codec

string

The audio codec format. Default value: acc.

mp3

Samplerate

string

The sampling rate.

  • Unit: Hz.

  • Default value: 44100.

32000

Qscale

string

The level of quality control on the audio.

10

Channels

string

The number of sound channels. Default value: 2.

1

Bitrate

string

The audio bitrate of the output file.

  • Unit: Kbit/s.

  • Default value: 128.

8

Id

string

The ID of the transcoding template.

S00000000-00****

Container

object

The container format configurations.

Format

string

The container format.

flv

UserData

string

The custom data.

testid-001

Code

string

The error code returned if the job failed. This parameter is not returned if the job was successful.

InvalidParameter.ResourceNotFound

InputFile

object

The information about the job input.

Object

string

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

example.flv

Location

string

The ID of the OSS region.

oss-cn-hangzhou

Bucket

string

The name of the OSS bucket.

example-bucket

PipelineId

string

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

bb558c1cc25b45309aab5be44d19****

Id

string

The ID of the template analysis job.

57f6aa3f84824309bcba67231b40****

Examples

Success response

JSON format

{
  "RequestId": "B52658D4-07AB-43CD-82B0-210958A65E23",
  "AnalysisJob": {
    "CreationTime": "2014-01-10T12:00:00Z",
    "Percent": 100,
    "State": "Success",
    "AnalysisConfig": {
      "QualityControl": {
        "MethodStreaming": "network",
        "RateQuality": "50"
      },
      "PropertiesControl": {
        "Deinterlace": "Force",
        "Crop": {
          "Top": "8",
          "Width": "8",
          "Height": "8",
          "Left": "8",
          "Mode": "Auto"
        }
      }
    },
    "Message": "The resource operated \\\"PipelineId\\\" cannot be found",
    "Priority": "10",
    "MNSMessageResult": {
      "MessageId": "3ca84a39a9024f19853b21be9cf9****",
      "ErrorMessage": "The resource operated \\\"PipelineId\\\" cannot be found",
      "ErrorCode": "InvalidParameter.ResourceNotFound"
    },
    "TemplateList": {
      "Template": [
        {
          "Video": {
            "Bufsize": "5000",
            "Degrain": "5",
            "BitrateBnd": {
              "Max": "20",
              "Min": "10"
            },
            "PixFmt": "yuvj420p",
            "Codec": "H.264",
            "Height": "1880",
            "Qscale": "15",
            "Bitrate": "10",
            "Maxrate": "10",
            "Profile": "baseline",
            "Crf": "27",
            "Gop": "1",
            "Width": "1990",
            "Fps": "60",
            "Preset": "medium",
            "ScanMode": "progressive"
          },
          "TransConfig": {
            "TransMode": "onepass"
          },
          "State": "Normal",
          "MuxConfig": {
            "Gif": {
              "FinalDelay": "0",
              "Loop": "0"
            },
            "Segment": {
              "Duration": "60"
            }
          },
          "Name": "FLV-UD",
          "Audio": {
            "Profile": "aac_low",
            "Codec": "mp3",
            "Samplerate": "32000",
            "Qscale": "10",
            "Channels": "1",
            "Bitrate": "8"
          },
          "Id": "S00000000-00****",
          "Container": {
            "Format": "flv"
          }
        }
      ]
    },
    "UserData": "testid-001",
    "Code": "InvalidParameter.ResourceNotFound",
    "InputFile": {
      "Object": "example.flv",
      "Location": "oss-cn-hangzhou",
      "Bucket": "example-bucket"
    },
    "PipelineId": "bb558c1cc25b45309aab5be44d19****",
    "Id": "57f6aa3f84824309bcba67231b40****"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.