The SubmitMediaProducingJob API submits a media production job. This job provides automated processing for post-production tasks, such as editing and composing video and audio assets.
Operation description
-
Billing: Video editing is charged based on the duration of the output video. For more information, see video editing. Failed jobs incur no charges.
-
Flexible editing capabilities: Use this operation to arrange and design assets. It supports complex video editing through flexible timeline configurations.
-
Asset reference rules: Assets referenced in the timeline can be media assets from your asset library or OSS objects. External URLs and CDN URLs are not supported. If an asset is an OSS object, MediaUrl must be an OSS URL, for example: https://your-bucket.oss-region-name.aliyuncs.com/your-object.ext.
-
Asynchronous job execution: This operation creates an asynchronous task. After you submit a job, the operation returns a task ID and queues the job for background processing. The job is not yet complete at this stage. The system delivers the final result via a callback notification. You can also query the job status by querying the editing and compositing job.
-
Job status query:
-
Call Query an editing and compositing job and pass the JobId to query the job status and result.
-
When you submit an editing and compositing job, you can include a callback URL in the UserData parameter of your request. When the job completes or fails, the system sends a notification to this callback URL. You can use the callback data to retrieve the job status.
-
-
Media asset registration and analysis: After video compositing completes, the system automatically registers a new media asset, which is initially in an analyzing state. After the analysis is complete, you can use the MediaId to retrieve the duration and resolution of the output video.
Limitations
-
The throttling limit for this operation is 30 QPS. Submitted jobs are queued and processed asynchronously.
NoteIf you exceed this limit, you may encounter a "Throttling.User" error. For more information, see "Throttling.User" error when submitting editing jobs.
-
When you submit a large number of jobs (for example, 1,000 or 10,000), the system scales out automatically, but you may experience queueing delays.
-
The maximum number of tracks is 100 for each type: video, image, and subtitle.
-
While there is no limit on the number of assets, their total size must not exceed 1 TB.
-
The region of the input or output OSS bucket must match the IMS region.
-
When the output is a video, the following resolution limits apply:
Both the width and height must be at least 128 px.
Neither the width nor the height can exceed 4096 px.
The shorter side cannot exceed 2160 px.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:SubmitMediaProducingJob |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
string |
No |
The ID of the editing project. Call the CreateEditingProject operation to create an editing project and obtain the Important You must specify one of the ProjectId, Timeline, or TemplateId parameters. The other two parameters must be left empty. |
xxxxxfb2101cb318xxxxx |
| Timeline |
string |
No |
The timeline for the cloud editing job. To arrange clips and design effects, manually construct the
Important You must specify one of the ProjectId, Timeline, or TemplateId parameters. The other two parameters must be left empty. |
{"VideoTracks":[{"VideoTrackClips":[{"MediaId":"****4d7cf14dc7b83b0e801c****"},{"MediaId":"****4d7cf14dc7b83b0e801c****"}]}]} |
| TemplateId |
string |
No |
The ID of a template for quickly building a timeline. You can use basic and advanced templates for video editing.
Important You must specify one of the ProjectId, Timeline, or TemplateId parameters. The other two parameters must be left empty.
|
****96e8864746a0b6f3**** |
| ClipsParam |
string |
No |
The clip parameters that correspond to the template, in JSON format. If |
见模板使用文档 |
| ProjectMetadata |
string |
No |
The metadata of the editing project, in JSON format. For details about the structure, see ProjectMetadata. |
{"Description":"剪辑视频描述","Title":"剪辑标题测试"} |
| OutputMediaTarget |
string |
No |
The target type for the output media. Valid values:
|
oss-object |
| OutputMediaConfig |
string |
Yes |
The configuration for the output media target, in JSON format. You can set the URL for the output media in OSS or the storage location in a VOD bucket.
For more information, see OutputMediaConfig parameter examples. |
{"MediaURL":"https://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4"} |
| UserData |
string |
No |
Custom user data in JSON format. The value can be up to 512 bytes in length. This parameter supports job completion callback configuration. The fields include:
|
{"NotifyAddress":"https://xx.com/xx","RegisterMediaNotifyAddress":"https://xxx.com/xx"} |
| ClientToken |
string |
No |
A client-generated token that ensures request idempotence. This token must be a unique value of up to 64 ASCII characters. |
****12e8864746a0a398**** |
| Source |
string |
No |
The source of the media producing job request. Valid values:
|
OPENAPI |
| EditingProduceConfig |
string |
No |
The parameters for the media producing job. For configuration details, see EditingProduceConfig parameter details. Note
If a cover is not configured in
|
{ "AutoRegisterInputVodMedia": "true", "OutputWebmTransparentChannel": "true" } |
| MediaMetadata |
string |
No |
The metadata of the output video, in JSON format. For details about the structure, 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 outputting to OSS, the MediaURL parameter is required. The OutputMediaTarget parameter defaults to oss-object, which sends the output to OSS. Other parameters are optional. The bitrate parameter sets the bitrate of the output file. A higher bitrate typically results in better quality, with a maximum value of 5000 Kbps. The width and height parameters set the resolution of the output file.
The OSS URL format is: https://bucketname.oss-region-name.aliyuncs.com/xxx/yyy.ext
bucketname is the name of your OSS bucket.
oss-region-name.aliyuncs.com is the public endpoint for OSS files. For example, the public endpoints for the China (Shanghai), China (Beijing), and China (Hangzhou) regions are:
oss-cn-shanghai.aliyuncs.com
oss-cn-hangzhou.aliyuncs.com
oss-cn-beijing.aliyuncs.com
Example: Output to ApsaraVideo for VOD
{
"StorageLocation": "outin-*xxxxxx7d2a3811eb83da00163exxxxxx.oss-cn-shanghai.aliyuncs.com",
"FileName": "output.mp4",
"Bitrate": 2000,
"Width": 800,
"Height": 680
}
When outputting to ApsaraVideo for VOD, the storageLocation and FileName parameters are required. Set the OutputMediaTarget parameter to vod-media to send the output to an ApsaraVideo for VOD storage bucket. To find available storage locations, view the storage location of an uploaded media asset in the ApsaraVideo for VOD console.
Parameters in OutputMediaConfig
| Parameter | Type | Description |
| MediaURL | String | The URL of the output media asset. When OutputMediaTarget is set to oss-object, specify the HTTP URL of the OSS object. For example: http://xxx-bucket-name.oss-cn-shanghai.aliyuncs.com/. The OSS bucket and the service making the call must be in the same region. |
| StorageLocation | String | When OutputMediaTarget is set to vod-media, specify the storage location in ApsaraVideo for VOD for the media asset. The storage location is the file storage path in ApsaraVideo for VOD and must not include the http:// prefix. For example: outin-xxxxxx.oss-cn-shanghai.aliyuncs.com. |
| FileName | String | When OutputMediaTarget is set to vod-media, specify the file name for the output file. The file name must include the file extension but not the path. |
| Width | Integer | The width of the output file. This parameter is optional. If not specified, the system uses the maximum width among all source materials. |
| Height | Integer | The height of the output file. This parameter is optional. If not specified, the system uses the maximum height among all source materials. |
| Bitrate | Integer | The bitrate of the output file, in Kbps. This parameter is optional. If not specified, the system uses the highest bitrate among all source materials, with a cap of 5000 Kbps. To retain the highest original bitrate even if it exceeds this cap, set EditingProduceConfig.KeepOriginMaxBitrate to true. For more information, see EditingProduceConfig. |
| VodTemplateGroupId | String | When outputting to ApsaraVideo for VOD, you can specify a VOD transcoding template group. If transcoding is not required, set this parameter to VOD_NO_TRANSCODE. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Response schema |
||
| RequestId |
string |
The request ID. |
****36-3C1E-4417-BDB2-1E034F**** |
| ProjectId |
string |
The project ID. |
****b4549d46c88681030f6e**** |
| JobId |
string |
The job ID. |
****d80e4e4044975745c14b**** |
| MediaId |
string |
The media ID. |
****c469e944b5a856828dc2**** |
| VodMediaId |
string |
The VOD media ID. Returned if the output destination 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.