Submits a transcoding job to start transcoding in an asynchronous manner.
Operation description
Usage notes
- Make sure that you understand the billing methods and prices of ApsaraVideo VOD before you call this operation. For more information about billing of the transcoding feature, see Billing of basic services.
- You can transcode a video only in the Uploaded, Normal, or Reviewing state.
- You can obtain the transcoding results from the StreamTranscodeComplete or TranscodeComplete callback.
- You can call this operation to dynamically override the subtitle URL in an HTTP Live Streaming (HLS) packaging task. If the packaging task does not contain subtitles, we recommend that you specify the ID of the specific packaging template group when you upload the video instead of calling this operation.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VideoId | string | Yes | The ID of the video file. You can use one of the following methods to obtain the video ID:
| 142710f878bd42508932f660d7b1**** |
TemplateGroupId | string | Yes | The ID of the transcoding template group that you want to use. To view the template group ID, perform the following operations: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups. | 0e408c803baf658ee637790c5d9f**** |
PipelineId | string | No | The ID of the queue that you want to use to run the job. | d3e680e618708erf45fbf2cae7c**** |
EncryptConfig | string | No | The encryption configurations. The value must be a JSON string. This parameter is required only when you use HLS encryption. Note
| {"CipherText":"ZjJmZGViNzUtZWY1Mi00Y2RlLTk3****", "DecryptKeyUri":"http://demo.aliyundoc.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3****","KeyServiceType":"KMS"} |
OverrideParams | string | No | The override parameter. The value must be a JSON string. You can use this parameter to override the image watermark, text watermark, or subtitle file specified in the transcoding template, or override the encoding format of the subtitle file. For more information about the data structure, see OverrideParams . | {"Watermarks":[{"WatermarkId":"af2afe4761992c47dae973374****","FileUrl":"http://developer.aliyundoc.com/image/image.png"},{"WatermarkId":"e8e5b8038d7ada85b376c2707****","Content":"watermark test"}]} |
Priority | string | No | The priority of the transcoding job in all queued jobs.
Note
This parameter takes effect only on the queued transcoding jobs. The priorities of the in-progress transcoding jobs are not affected.
| 6 |
UserData | string | No | The custom settings. The value must be a JSON string. You can configure settings such as message callbacks. For more information, see UserData . Note
To use the callback configurations specified by this parameter, you must configure an HTTP callback URL and specify the types of the callback events in the ApsaraVideo VOD console. Otherwise, the callback configurations do not take effect.
| {"Extend":{"localId":"****","test":"***"}} |
Response parameters
Examples
Sample success responses
JSON
format
{
"TranscodeTaskId": "9f4a0df7da2c8a81c8c0408c84****",
"RequestId": "E4EBD2BF-5EB0-4476-8829-9D94E1B1****",
"TranscodeJobs": {
"TranscodeJob": [
{
"JobId": "d8921ce8505716cfe86fb112c4****"
}
]
}
}
Error codes
For a list of error codes, visit the Service error codes.
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. |