Submits a media editing and producing job. This API operation automates the editing, producing, and other post-production processes for video or audio materials.
Operation description
-
Billing: Video editing is billed based on the duration of the produced video. For more information, see Video editing. No fees are charged if the processing fails.
-
Diverse editing capabilities: Invoke this API operation when you need to arrange and design materials based on personalized ideas. This API operation supports flexible timeline configurations to meet complex video editing requirements.
-
Material reference rules: Materials referenced in the cloud editing timeline can be media assets in the media asset library, OSS files (recommended), or other public URLs. If the material is an OSS file, MediaUrl only supports the OSS address format, such as https://your-bucket.oss-region-name.aliyuncs.com/your-object.ext. If the material is another public URL, the task duration increases.
-
Asynchronously execute tasks: - This API operation is an asynchronous task. After you submit the task, a task ID is returned (the task is not completed at this time and enters the background queue to execute asynchronously). The final result is notified through a callback. You can also invoke the query media editing and producing jobs operation to actively query the task status.
-
Task status query:
-
Invoke the query media editing and producing jobs operation and pass the JobId parameter to query the task status and result.
-
When submitting a media editing and producing job, you can set UserData in the request parameters to include a callback URL. When the editing task is completed or fails, the system sends a notification to this callback URL. You can process the callback data to obtain the task status.
-
-
Media asset registration and analysis: After the video is produced, the media asset is automatically registered. At this time, the media asset is in the analyzing state. After the analysis is completed, you can obtain the duration and resolution information of the produced video based on the MediaId.
Limits
-
The rate limit for this API operation is 30 QPS (requests per second for submitting tasks). Submitted tasks enter the background queue and are processed asynchronously.
NoteIf this limit is exceeded, you may encounter the "Throttling.User" error. For more information, see Throttling.User error when submitting an editing task.
-
When you submit a large number of tasks (such as 1,000 or 10,000), the system dynamically scales out, but a certain queue time may be required.
-
The maximum number of tracks for video, image, and subtitle tracks is 100 each.
-
There is no limit on the number of materials, but the total size of material files cannot exceed 1 TB.
-
The region of the input or output OSS bucket must be the same as the region where Intelligent Media Services (IMS) is used.
-
When the output is a video, the resolution of the produced video has the following limits:
The width and height cannot be less than 128 pixels.
The width and height cannot be greater than 4,096 pixels.
The short side cannot be greater than 2,160 pixels.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:SubmitMediaProducingJob |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
string |
No |
The ID of the editing project. You can call the CreateEditingProject operation to create an editing project and obtain the ProjectId parameter to submit an editing task. Important You must specify one of the ProjectId, Timeline, and TemplateId parameters, and leave the other two parameters empty. |
xxxxxfb2101cb318xxxxx |
| Timeline |
string |
No |
The timeline of the cloud editing task. When you need to arrange materials and design special effects based on video ideas, you can manually construct the Timeline parameter.
Important You must specify one of the ProjectId, Timeline, and TemplateId parameters, and leave the other two parameters empty. |
{"VideoTracks":[{"VideoTrackClips":[{"MediaId":"****4d7cf14dc7b83b0e801c****"},{"MediaId":"****4d7cf14dc7b83b0e801c****"}]}]} |
| TemplateId |
string |
No |
The ID of the template. This parameter is used to quickly build a timeline with a low threshold. Video editing based on common templates and advanced templates is supported.
Important You must specify one of the ProjectId, Timeline, and TemplateId parameters, and leave the other two parameters empty.
|
****96e8864746a0b6f3**** |
| ClipsParam |
string |
No |
The material parameters corresponding to the template, in JSON format. When TemplateId is not empty, ClipsParam cannot be empty. For the specific format, see Create and use common templates and Create and use advanced templates. |
See the template usage documentation |
| ProjectMetadata |
string |
No |
The metadata information of the editing project, in JSON format. For the specific structure definition, see ProjectMetadata. |
{"Description":"Edited video description","Title":"Editing title test"} |
| OutputMediaTarget |
string |
No |
The target type of the output product. Valid values:
|
oss-object |
| OutputMediaConfig |
string |
Yes |
The target configuration of the output product, in JSON format. You can set the URL of the output product in OSS or the storage location in the VOD bucket.
|
{"MediaURL":"https://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4"} |
| UserData |
string |
No |
The custom settings, in JSON format. The maximum length is 512 bytes. Task completion callback configurations are supported. Parameters:
|
{"NotifyAddress":"https://xx.com/xx","RegisterMediaNotifyAddress":"https://xxx.com/xx"} |
| ClientToken |
string |
No |
Ensures the idempotence of the request. You can generate a parameter value from your client to ensure that the parameter value is unique across different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters. |
****12e8864746a0a398**** |
| Source |
string |
No |
The source of the editing and producing request. Valid values:
|
OPENAPI |
| EditingProduceConfig |
string |
No |
The editing and producing parameters. For configuration details, see EditingProduceConfig parameter details. Note
If no cover image is configured in EditingProduceConfig, the first frame of the video is used as the cover by default.
|
{ "AutoRegisterInputVodMedia": "true", "OutputWebmTransparentChannel": "true" } |
| MediaMetadata |
string |
No |
The metadata of the produced video, in JSON format. For the specific structure definition, see MediaMetadata. |
{ "Title":"test-title", "Tags":"test-tags1,tags2" } |
OutputMediaConfig parameter examples
Example: Output to OSS
{
"MediaURL":"https://my-test-bucket.oss-cn-shanghai.aliyuncs.com/test/xxxxxtest001xxxxx.mp4",
"Bitrate": 2000,
"Width": 800,
"Height": 680
}
When the output is to OSS, MediaURL is required. The default value of the OutputMediaTarget parameter is "oss-object", which indicates that the output is to OSS. Other parameters are optional. Bitrate is used to set the bitrate of the output product. Generally, a higher bitrate indicates clearer quality, and the maximum value is 5000. Width and Height are used to set the resolution of the output product.
Path format of the OSS URL: https://bucketname.oss-region-name.aliyuncs.com/xxx/yyy.ext
bucketname is the name of the OSS bucket.
oss-region-name.aliyuncs.com is the public endpoint of the OSS file. For example, the endpoints for Shanghai, Beijing, and Hangzhou are:
oss-cn-shanghai.aliyuncs.com
oss-cn-hangzhou.aliyuncs.com
oss-cn-beijing.aliyuncs.com
Example: Output to VOD
{
"StorageLocation": "outin-*xxxxxx7d2a3811eb83da00163exxxxxx.oss-cn-shanghai.aliyuncs.com",
"FileName": "output.mp4",
"Bitrate": 2000,
"Width": 800,
"Height": 680
}
When the output is to VOD, the StorageLocation and FileName parameters are required. Set the OutputMediaTarget parameter to "vod-media", which indicates that the output is to the storage bucket of ApsaraVideo VOD. The available storage locations in ApsaraVideo VOD can be viewed in the storage address of the media asset after you upload the media asset in VOD.
Parameter descriptions in the OutputMediaConfig structure
| Parameter | Type | Description |
| MediaURL | String | The URL of the output media asset. When the target of OutputMediaTarget is oss-object, specify the HTTP URL path of the OSS file, such as http://xxx-bucket-name.oss-cn-shanghai.aliyuncs.com/. The OSS region must be the same as the region where the invoked service resides. |
| StorageLocation | String | When the target of OutputMediaTarget is vod-media, specify the storage location to store the media asset in VOD. The storage location is the file storage location in VOD and does not include the http:// prefix, such as outin-xxxxxx.oss-cn-shanghai.aliyuncs.com. |
| FileName | String | When the target of OutputMediaTarget is vod-media, specify the fileName (including the file extension but excluding the path) as the output file name. |
| Width | Integer | The width of the output product. This parameter is optional. The default value is the maximum width of multiple materials. |
| Height | Integer | The height of the output product. This parameter is optional. The default value is the maximum height of multiple materials. |
| Bitrate | Integer | The bitrate of the output product, in Kbps. This parameter is optional. The default value is the highest bitrate of multiple materials, and the upper limit is 5000. To retain the highest bitrate of the materials, set EditingProduceConfig.KeepOriginMaxBitrate to true. For more details, see EditingProduceConfig. |
| VodTemplateGroupId | String | The VOD transcoding template group specified when the produced video is output to VOD. If VOD transcoding is not required, set this parameter to "VOD_NO_TRANSCODE". |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The ID of the request. |
****36-3C1E-4417-BDB2-1E034F**** |
| ProjectId |
string |
The ID of the editing project. |
****b4549d46c88681030f6e**** |
| JobId |
string |
The ID of the producing job. |
****d80e4e4044975745c14b**** |
| MediaId |
string |
The ID of the produced media asset. |
****c469e944b5a856828dc2**** |
| VodMediaId |
string |
The ID of the VOD media asset. This parameter is returned if the video output location is VOD. |
****d8s4h75ci975745c14b**** |
Examples
Success response
JSON format
{
"RequestId": "****36-3C1E-4417-BDB2-1E034F****",
"ProjectId": "****b4549d46c88681030f6e****",
"JobId": "****d80e4e4044975745c14b****",
"MediaId": "****c469e944b5a856828dc2****",
"VodMediaId": "****d8s4h75ci975745c14b****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter \ is not valid. | |
| 404 | ProjectNotFound | The specified project not found |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.