Submits a transcoding job and starts asynchronous transcoding.

Note
  • 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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
  • In the JSON-formatted string of the EncryptConfig parameter, you must set the CipherText parameter to an AES-128 ciphertext key that is generated by calling the GenerateDataKey operation. Otherwise, the transcoding job that uses HLS encryption fails. For more information about how to use HLS encryption, see HLS encryption.
  • Regardless of whether HLS encryption or Alibaba Cloud proprietary cryptography is required, you must enable HLS encryption for the template group that is specified by the TemplateGroupId parameter. Otherwise, HLS encryption cannot be used.
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.

  • Valid values: 1 to 10.
  • A value of 10 indicates the highest priority.
  • Default value: 6.
    Note This parameter specifies the priority of only the current transcoding job in all queued jobs and does not affect the priorities of jobs that are running.
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: