All Products
Search
Document Center

ApsaraVideo Media Processing:SubmitAnalysisJob

Last Updated:Oct 13, 2026

Submits a preset template analysis job.

Operation description

  • After you submit a job by calling this operation, ApsaraVideo Media Processing intelligently analyzes the input file and recommends preset templates that are suitable for the input file. You can obtain the template analysis job result by calling the Query template analysis jobs operation, or use the asynchronous notification mechanism.

  • The preset template analysis results are retained for only half a month from the time the results are generated. After half a month, the results are deleted. If you use a recommended preset template to submit a job after half a month, the transcoding job fails and the AnalysisResultNotFound error code is returned.

QPS limits

The QPS limit for a single user is 100 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Make API calls at a reasonable rate. 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:SubmitAnalysisJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Input

string

Yes

The job input, which is a JSON object. You must grant the read permissions on the bucket to ApsaraVideo Media Processing on the bucket authorization page in the OSS console. For more information, see Parameter details.

Note

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

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

AnalysisConfig

string

No

The configuration of the template analysis job. Set the parameters as needed. For more information, see Parameter details.

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

UserData

string

No

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

testid-001

PipelineId

string

Yes

The ID of the MPS queue. You can view the ID by choosing MPS Console > Global Settings > Pipelines. If asynchronous notification is required, make sure that an available message topic is bound to this MPS queue.

bb558c1cc25b45309aab5be44d19****

Priority

string

No

The transcoding priority of the job in its corresponding MPS queue.

  • Valid values: [1,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 request ID.

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

AnalysisJob

object

The template analysis job for system preset templates.

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

Percent

integer

The transcoding progress.

100

State

string

The job status. Valid values:

  • Submitted: The job is submitted.

  • Analyzing: The job is being analyzed.

  • Success: The analysis succeeded.

  • Fail: The analysis failed.

Success

AnalysisConfig

object

The job configuration.

QualityControl

object

The output quality control.

MethodStreaming

string

The playback method. Valid values:

  • network: Online.

  • local: Local. Default value: network.

network

RateQuality

string

The output quality level.

50

PropertiesControl

object

The property control.

Deinterlace

string

The forced scan mode determination. Valid values:

  • Auto: Automatic.

  • Force: Forced deinterlacing.

  • None: No forced deinterlacing.

Force

Crop

object

The video cropping configuration.

Top

string

The top margin for cropping.

Note

If Mode is set to Auto or None, this value does not take effect.

8

Width

string

The width after cropping.

Note

If Mode is set to Auto or None, this value does not take effect.

8

Height

string

The height after cropping.

Note

If Mode is set to Auto or None, this value does not take effect.

8

Left

string

The left margin for cropping.

Note

If Mode is set to Auto or None, this value does not take effect.

8

Mode

string

The cropping method. Valid values:

  • Auto: Automatic. This is the default value.

  • Force: Forced.

  • None: No forced cropping.

Auto

Message

string

The error message returned when the analysis fails.

The resource operated \"PipelineId\" cannot be found

Priority

string

The priority of the job in the corresponding MPS queue.

  • Valid values: [1,10]. A value of 10 indicates the highest priority.

  • Default value: 10.

10

MNSMessageResult

object

The result of the MNS notification sent to the user when the job is completed.

MessageId

string

The message ID returned when the analysis is successful. This parameter is not returned when the analysis fails.

3ca84a39a9024f19853b21be9cf9****

ErrorMessage

string

The error message returned when the analysis fails. This parameter is not returned when the analysis is successful.

The resource operated \"PipelineId\" cannot be found

ErrorCode

string

The error code returned when the analysis fails. This parameter is not returned when the analysis is successful.

InvalidParameter.ResourceNotFound

TemplateList

object

Template

array<object>

The list of preset templates output by the job.

array<object>

The details of the preset templates output by the job.

Video

object

The video codec configuration.

Bufsize

string

The buffer size.

  • Unit: Kb.

  • Default value: 6000.

5000

Degrain

string

The strength of the independent denoising algorithm.

5

BitrateBnd

object

The average video bitrate range.

Max

string

The upper limit of the total bitrate. Unit: Kbps.

20

Min

string

The lower limit of the total bitrate. Unit: Kbps.

10

PixFmt

string

The video color format. Standard color formats such as yuv420p and yuvj420p are supported.

yuvj420p

Codec

string

The codec format. Default value: H.264.

H.264

Height

string

The video height.

  • Unit: px.

  • Default value: Original video height.

1880

Qscale

string

The video quality control level.

15

Bitrate

string

The average video bitrate. Unit: Kbps.

10

Maxrate

string

The peak video bitrate. Unit: Kbps.

10

Profile

string

The encoding profile. Valid values:

  • baseline: For shift devices.

  • main: For standard resolution devices.

  • high: For high resolution devices.

  • Default value: high.

baseline

Crf

string

The constant rate factor (CRF) for bitrate and quality control.

  • Default value: If the encoding format is H.264, the default value is 23. If the encoding format is H.265, the default value is 26.

  • If Crf is set, the Bitrate setting does not take effect.

27

Gop

string

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

1

Width

string

The video width.

  • Unit: px.

  • Default value: Original video width.

1990

Fps

string

The frame rate.

  • If the frame rate of the input file exceeds 60, the value 60 is used.

  • Default value: Frame rate of the input file.

60

Preset

string

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

medium

ScanMode

string

The scan mode. Valid values:

  • interlaced: Interlaced scanning.

  • progressive: Progressive scanning.

progressive

TransConfig

object

The general transcoding configuration.

TransMode

string

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

onepass

State

string

The template status. Valid values:

  • Normal: Normal.

  • Deleted: Deleted.

Normal

MuxConfig

object

The transcoding muxing configuration.

Gif

object

The GIF format.

FinalDelay

string

The loop interval of the GIF. Unit: hundredths of a second. For example, 500 indicates an interval of 5 seconds.

0

Loop

string

The number of loops for GIF and WebP. By default, no loop is performed.

0

Segment

object

The segment configuration.

Duration

string

The segment duration. Unit: seconds.

60

Name

string

The template name.

FLV-UD

Audio

object

The audio codec configuration.

Profile

string

The audio encoding preset. When Codec is set to aac, valid values are aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld.

aac_low

Codec

string

The audio codec format. Default value: aac.

mp3

Samplerate

string

The sampling rate.

  • Unit: Hz.

  • Default value: 44100.

32000

Qscale

string

The audio quality control level.

10

Channels

string

The number of audio channels. Default value: 2.

1

Bitrate

string

The audio bitrate of the output file.

  • Unit: Kbps.

  • Default value: 128.

8

Id

string

The transcoding template ID.

S00000000-00****

Container

object

The container.

Format

string

The container format.

flv

UserData

string

The user-defined data.

testid-001

Code

string

The error code returned when the analysis fails. This parameter is not returned when the analysis is successful.

InvalidParameter.ResourceNotFound

InputFile

object

The job input.

Object

string

The OSS object.

example.flv

Location

string

The OSS region.

oss-cn-hangzhou

Bucket

string

The OSS bucket.

example-bucket

PipelineId

string

The MPS queue ID.

bb558c1cc25b45309aab5be44d19****

Id

string

The template analysis job ID.

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.