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
AnalysisResultNotFounderror 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
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, 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.
|
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:
|
Success |
| AnalysisConfig |
object |
The job configuration. |
|
| QualityControl |
object |
The output quality control. |
|
| MethodStreaming |
string |
The playback method. Valid values:
|
network |
| RateQuality |
string |
The output quality level. |
50 |
| PropertiesControl |
object |
The property control. |
|
| Deinterlace |
string |
The forced scan mode determination. Valid values:
|
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 |
| 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.
|
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.
|
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.
|
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 |
| Crf |
string |
The constant rate factor (CRF) for bitrate and quality control.
|
27 |
| Gop |
string |
The maximum number of frames between keyframes. Default value: 250. |
1 |
| Width |
string |
The video width.
|
1990 |
| Fps |
string |
The frame rate.
|
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:
|
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 |
| 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.
|
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.
|
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.