Submits a transcoding job and starts asynchronous transcoding.
- You can transcode a video only in the UploadSucc, Normal, or Checking state.
- You can obtain the transcoding result in the StreamTranscodeComplete or TranscodeComplete event notification.
- If you initiate an HTTP Live Streaming (HLS) packaging task, you can call this operation to dynamically override the subtitle. If the packaging task does not contain subtitles, we recommend that you do not call this operation to initiate the packaging task. Instead, you can specify the ID of the specific template group when you upload the video. The packaging process is automatically initiated.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SubmitTranscodeJobs |
The operation that you want to perform. Set the value to SubmitTranscodeJobs. |
TemplateGroupId | String | Yes | ea2727ecc0*****5ff43c04878f4e1 |
The ID of the transcoding template group used when the video is transcoded. To specify a transcoding template group, you can log on to the ApsaraVideo VOD console and view the ID of the transcoding template group on the Transcode page. |
VideoId | String | No | 0222e203cf*****72f9c22870a4d2c |
The ID of the video. Note The VideoId parameter is required.
|
PipelineId | String | No | d3e680e618708*****fbf2cae7cc931 |
The ID of the pipeline. |
EncryptConfig | String | No | {"CipherText":"ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt", "DecryptKeyUri":"http://decrypt.demo.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt","KeyServiceType":"KMS"} |
The encryption configurations. The value is a JSON-formatted string. This parameter is required only when HLS encryption is used. Note
|
OverrideParams | String | No | {"Watermarks":[{"WatermarkId":"af2afe4761992c*****47dae97337","FileUrl":"http://test.bucket.aliyuncs.com/image/replace.png"},{"WatermarkId":"e8e5b8038d7a*****da85b376c270","Content":"Watermark test"}]} |
The parameters used for overriding. The value is a JSON-formatted string. You can set this parameter to override the watermark or subtitle that is associated with the transcoding template. You can override the file URL of an image watermark, the content of a text watermark, the URL of a subtitle file, and the encoding format of a subtitle file. For more information about the data structure, see the "OverrideParams" section of the Media processing parameters topic. |
Priority | String | No | 6 |
The priority of the current transcoding job in all queued jobs.
|
UserData | String | No | {"Extend":{"localId":"****","test":"***"}} |
The custom configurations, including callback configurations. The value is a JSON-formatted string. For more information, see the "UserData" section of the Request parameters topic. Note The callback configurations take effect only when you specify an HTTP callback URL
and select specific callback events in the ApsaraVideo VOD console.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B1DBEFB3-3371-4E*****43-708259D719CE |
The ID of the request. |
TranscodeJobs | Array of TranscodeJob |
The transcoding jobs. Note This parameter is not returned for HLS packaging tasks. You must asynchronously receive
the transcoding result.
|
|
TranscodeJob | |||
JobId | String | d8921ce85057*****16cfe86fb112c |
The ID of the job. |
TranscodeTaskId | String | 9f4a0df7da2c*****8a81c8c0408c8 |
The ID of the transcoding job that was submitted. |
Examples
Sample requests
https://vod.{ApiRegion}.aliyuncs.com/?Action=SubmitTranscodeJobs
&TemplateGroupId=ea2727ecc0*****5ff43c04878f4e1
&<Common request parameters>
Sample success responses
XML
format
<SubmitTranscodeJobsResponse>
<RequestId>B1DBEFB3-3371-4E*****43-708259D719CE</RequestId>
<TranscodeJobs>
<TranscodeJob>
<JobId>d8921ce85057*****16cfe86fb112c</JobId>
</TranscodeJob>
</TranscodeJobs>
<TranscodeTaskId>9f4a0df7da2c*****8a81c8c0408c8</TranscodeTaskId>
</SubmitTranscodeJobsResponse>
JSON
format
{
"RequestId": "B1DBEFB3-3371-4E*****43-708259D719CE",
"TranscodeJobs": {
"TranscodeJob": [
{
"JobId": "d8921ce85057*****16cfe86fb112c"
}
]
},
"TranscodeTaskId": "9f4a0df7da2c*****8a81c8c0408c8"
}
Error codes
For a list of error codes, visit the API Error Center.
Common errors
The following table describes the common errors that this operation can return.
Error code |
Error message |
HTTP status code |
Description |
---|---|---|---|
InvalidVideo.NotFound |
The video does not exist. |
404 |
The error message returned because the video does not exist. |
NoSuchResource |
The specified resource %s does not exist. |
404 |
The error message returned because the user-related resource does not exist. %s indicates the specific resource information. |
Forbidden.IllegalStatus |
Status of the video is illegal. |
400 |
The error message returned because the video status is invalid. You can transcode a video only in the UploadSucc, Normal, or Checking state. |
SDK examples
We recommend that you use a server SDK to call this operation. For more information about the sample code that is used to call this operation in various languages, see the following topics: