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
AnalysisResultNotFounderror 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
Test
RAM authorization
|
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.
|
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:
|
Success |
| AnalysisConfig |
object |
The job configurations. |
|
| QualityControl |
object |
The quality control on the job output. |
|
| MethodStreaming |
string |
The playback mode. Valid values:
|
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:
|
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 |
| 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.
|
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.
|
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.
|
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 |
| Crf |
string |
The constant rate factor.
|
27 |
| Gop |
string |
The maximum number of frames between two keyframes. Default value: 250. |
1 |
| Width |
string |
The width of the video.
|
1990 |
| Fps |
string |
The frame rate.
|
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:
|
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 |
| 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.
|
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.
|
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.