Submits transcoding jobs. If the transcoding jobs and workflows created in the ApsaraVideo Media Processing (MPS) console cannot meet your business requirements, you can call the SubmitJobs operation to submit transcoding jobs. Specify transcoding parameters as required when you call the SubmitJobs operation.
Operation description
-
If the transcoding jobs and workflows created in the ApsaraVideo Media Processing (MPS) console cannot meet your business requirements, you can call the SubmitJobs operation to submit transcoding jobs. Set transcoding parameters as required when you call the SubmitJobs operation.
-
If you want to use multiple accounts in MPS, you can create RAM users by using your Alibaba Cloud account and grant the MPSfullaccess permission to the RAM users. If the Alibaba Cloud account that is used to query transcoding jobs is not the Alibaba Cloud account that is used to create the transcoding jobs, no data is returned. For more information, see Create and grant permissions to a RAM user.
-
A transcoding job is generated for each transcoding output. This API operation returns the transcoding jobs that are generated.
-
A video is re-encoded during transcoding in MPS. The bitrate of the transcoded video may be different from that of the source video. If you want to retain the bitrate of a video during transcoding, you can use a container format conversion template. For more information, see Preset template details.
-
Jobs are added to an MPS queue in which the jobs are scheduled and executed. After the jobs are executed, you can call the QueryJobList operation to query the results of the jobs. Alternatively, you can enable asynchronous notifications so that you can be automatically notified of the job results.
- To use an intelligent preset template to transcode a video, you must first call the SubmitAnalysisJob operation to submit a preset template analysis job for the video. After the preset template analysis job is complete, you can call the QueryAnalysisJobList operation to obtain the intelligent preset templates that are applicable to the video.
TemplateId
parameter to the ID of an applicable preset template. If you specify a preset template that is not in the applicable preset templates when you submit a transcoding job, the transcoding job fails.
-
If you use a static preset template to transcode a video, you do not need to submit a preset template analysis job first.
-
The size of the file in a transcoding job is up to 100 GB. Otherwise, the transcoding job may fail.
-
For information about transcoding FAQ, see FAQs in MPS.
QPS limit
You can call this API operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limit.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Input | string | Yes | The input of the jobs. Specify the value in a JSON object. Referer is an optional parameter. If you need to set a referer whitelist in a transcoding job, you must set the Referer parameter in the input. For more information about the fields in the Input parameter, see Input . Note
You can specify the {ObjectPrefix} , {FileName} , and {ExtName} variables in an OSS URL. MPS can dynamically replace the variables with the actual values. For example, if you specify a/b/c/test.flv as the object to be used as the input file and {ObjectPrefix}{FileName}-cn.srt as the object to be used as the external subtitle file, MPS replaces the variables to obtain the OSS URL a/b/c/test-cn.srt of the external subtitle file. The OSS URL that you specify must be URL-encoded. Therefore, you must specify the OSS URL of the external subtitle file as %7bObjectPrefix%7d%7bFileName%7d-cn.srt . Therefore, you must specify the OSS URL of the external subtitle file as a/b/c/test-cn.srt .
| a/b/c/test-cn.srt |
Outputs | string | Yes | The outputs of the jobs.
Note
If you need to merge images in a transcoding job, set the width and height of each image to be processed to even numbers. Otherwise, the job may fail.
| [{"OutputObject":"exampleOutput.mp4","TemplateId":"6181666213ab41b9bc21da8ff5ff****","WaterMarks":[{"InputFile":{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"image_01.png"},"WaterMarkTemplateId":"9b772ce2740d4d55876d8b542d47****"}],"UserData":"testid-001"}] |
OutputBucket | string | Yes | The name of the output bucket. To obtain the name of an output bucket, you can log on to the MPS console and choose Workflows > Media Buckets in the left-side navigation pane. | exampleBucket |
OutputLocation | string | No | The region in which the output bucket resides. | oss-cn-hangzhou |
PipelineId | string | Yes | The ID of the MPS queue. To obtain the ID of an MPS queue, you can log on to the MPS console and choose Global Settings > Pipelines in the left-side navigation pane.
| dd3dae411e704030b921e52698e5**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"JobResultList": {
"JobResult": [
{
"Job": {
"CreationTime": "2014-01-10T12:00:00Z",
"Percent": 100,
"FinishTime": "2014-01-10T12:20:00Z",
"State": "Submitted",
"JobId": "31fa3c9ca8134f9cec2b4b0b0f78****",
"Code": "InternalError",
"Message": "The operation has failed due to some unknown error, exception or failure.",
"Output": {
"Video": {
"Bufsize": "1000",
"Degrain": "5",
"BitrateBnd": {
"Max": "20",
"Min": "10"
},
"PixFmt": "yuvj420p",
"Pad": "1280:800:0:140",
"Codec": "H.264",
"Height": "1280",
"Qscale": "15",
"Crop": "1280:800:0:140",
"Bitrate": "10",
"Maxrate": "10",
"MaxFps": "15",
"Profile": "baseline",
"Crf": "22",
"Gop": "1",
"Width": "1080",
"Fps": "60",
"Preset": "veryfast",
"ScanMode": "interlaced",
"ResoPriority": "1"
},
"TransConfig": {
"IsCheckAudioBitrate": "false",
"TransMode": "onepass",
"IsCheckReso": "false",
"IsCheckVideoBitrateFail": "true",
"AdjDarMethod": "crop",
"IsCheckVideoBitrate": "false",
"IsCheckResoFail": "false",
"IsCheckAudioBitrateFail": "true"
},
"Encryption": {
"Type": "hls-aes-128",
"Key": "encryptionkey128",
"KeyType": "Base64",
"Id": "31fa3c9ca8134f9cec2b4b0b0f78****",
"KeyUri": "https://1161758785*****.cn-shanghai.fc.aliyuncs.com/2016-08-15/proxy/HLS-decyptServer/decyptServer/",
"SkipCnt": "3"
},
"WaterMarkList": {
"WaterMark": [
{
"Type": "Image",
"ReferPos": "TopRight",
"Dx": "1",
"Width": "1080",
"Height": "1280",
"InputFile": {
"Object": "example-logo-****.png",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket"
},
"WaterMarkTemplateId": "88c6ca184c0e47098a5b665e2a12****",
"Dy": "1"
}
]
},
"WaterMarkConfigUrl": "http://example.com/configure",
"DeWatermark": "{\"0\": [{\"l\": 10,\"t\": 10,\"w\": 10,\"h\": 10},{\"l\": 100,\"t\": 0.1,\"w\": 10,\"h\": 10}],\"128000\": [],\"250000\": [{\"l\": 0.2,\"t\": 0.1,\"w\": 0.01,\"h\": 0.05}]}",
"M3U8NonStandardSupport": {
"TS": {
"SizeSupport": true,
"Md5Support": true
}
},
"Priority": "5",
"Audio": {
"Profile": "aac_low",
"Codec": "aac",
"Samplerate": "32000",
"Qscale": "15",
"Channels": "6",
"Volume": {
"Method": "auto",
"Level": "-20"
},
"Bitrate": "128"
},
"AudioStreamMap": "0:a:0",
"MergeList": {
"Merge": [
{
"Start": "00000.50",
"RoleArn": "acs:ram::<your uid>:role/<your role name>",
"MergeURL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/example-object-****.flv",
"Duration": "00000.20"
}
]
},
"SuperReso": {
"IsHalfSample": "true"
},
"UserData": "example data",
"OutSubtitleList": {
"OutSubtitle": [
{
"Map": "0:v:0",
"OutSubtitleFile": {
"RoleArn": "acs:ram::<your uid>:role/<your role name>",
"Object": "example-output.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
},
"Success": true,
"Message": "The specified parameter “%s” cannot be null."
}
]
},
"DigiWaterMark": {
"Type": "Image",
"Alpha": "1.0",
"InputFile": {
"Object": "example-intput.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
}
},
"VideoStreamMap": "0:a:0",
"OutputFile": {
"RoleArn": "acs:ram::<your uid>:role/<your role name>",
"Object": "example-output.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
},
"AmixList": {
"Amix": [
{
"Map": "0:a:0",
"Start": "0",
"AmixURL": "https://outpu***.oss-cn-shanghai.aliyuncs.com/mp4-to-mp3%5E1571025263578816%40.mp3",
"Duration": "20",
"MixDurMode": "long"
}
]
},
"Rotate": "180",
"Container": {
"Format": "flv"
},
"Clip": {
"TimeSpan": {
"Seek": "01:59:59.999",
"Duration": "01:00:59.999"
}
},
"MergeConfigUrl": "`{\"MergeList\":[{\"MergeURL\":\"http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/video_01.mp4\"}]}",
"OpeningList": {
"Opening": [
{
"openUrl": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv",
"Start": "1",
"Width": "1920",
"Height": "1080"
}
]
},
"MuxConfig": {
"Webp": {
"Loop": "0"
},
"Gif": {
"FinalDelay": "0",
"DitherMode": "bayer",
"Loop": "0",
"IsCustomPalette": "false"
},
"Segment": {
"Duration": "20"
}
},
"TailSlateList": {
"TailSlate": [
{
"Start": "1",
"BgColor": "White",
"IsMergeAudio": false,
"Width": "1920",
"Height": "1080",
"BlendDuration": "2",
"TailUrl": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv"
}
]
},
"TemplateId": "S00000000-000010",
"SubtitleConfig": {
"ExtSubtitleList": {
"ExtSubtitle": [
{
"CharEnc": "UTF-8",
"FontName": "\"WenQuanYi Zen Hei\", \"Yuanti SC Regular\", \"SimSun\"",
"Input": {
"Object": "example-output.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
}
}
]
},
"SubtitleList": {
"Subtitle": [
{
"Map": "0:a:0"
}
]
}
},
"Properties": {
"Width": "1280",
"Height": "720",
"Duration": "55",
"Fps": "25",
"Bitrate": "1000",
"FileFormat": "QuickTime / MOV",
"Streams": {
"VideoStreamList": {
"VideoStream": [
{
"Index": "0",
"Timebase": "1/24000",
"AvgFPS": "23.976025",
"PixFmt": "yuv420p",
"Sar": "1:1",
"Lang": "eng",
"CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"Height": "720",
"NumFrames": "25",
"Bitrate": "1496.46",
"CodecTagString": "avc1",
"HasBFrames": "2",
"Profile": "high",
"StartTime": "0.000000",
"NetworkCost": {
"PreloadTime": "8",
"AvgBitrate": "100",
"CostBandwidth": "10"
},
"Dar": "16:9",
"CodecName": "h264",
"Width": "1280",
"Duration": "17.225542",
"Fps": "23.976025",
"CodecTag": "0x31637661",
"CodecTimeBase": "1001/48000",
"Level": "51"
}
]
},
"AudioStreamList": {
"AudioStream": [
{
"Timebase": "1/44100",
"Index": "1",
"SampleFmt": "fltp",
"ChannelLayout": "stereo",
"Lang": "eng",
"Samplerate": "44100",
"CodecLongName": "AAC (Advanced Audio Coding)",
"Channels": "2",
"NumFrames": "25",
"Bitrate": "128.806",
"CodecTagString": "mp4a",
"StartTime": "0.000000",
"CodecName": "aac",
"Duration": "17.159546",
"CodecTag": "0x6134706d",
"CodecTimeBase": "1/44100"
}
]
},
"SubtitleStreamList": {
"SubtitleStream": [
{
"Index": "1",
"Lang": "eng"
}
]
}
},
"Format": {
"StartTime": "0.000000",
"NumPrograms": "0",
"Size": "3509895",
"NumStreams": "2",
"FormatLongName": "QuickTime / MOV",
"Duration": "55",
"Bitrate": "1000",
"FormatName": "mov"
},
"FileSize": "3509895"
}
},
"PipelineId": "88c6ca184c0e47098a5b665e2a126797",
"Input": {
"Object": "example.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
},
"MNSMessageResult": {
"MessageId": "123",
"ErrorMessage": "The resource operated \"%s\" cannot be found.",
"ErrorCode": "InvalidParameter.ResourceNotFound"
}
},
"Success": true,
"Code": "InvalidParameter.NullValue",
"Message": "The specified parameter \"%s\" cannot be null."
}
]
},
"RequestId": "25818875-5F78-4A45S71F6-D73936451234"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|