All Products
Search
Document Center

ApsaraVideo VOD:SubmitTranscodeJobs

Last Updated:Aug 04, 2023

Submits a transcoding job and starts asynchronous transcoding.

Operation Description

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

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vod:SubmitTranscodeJobsWrite
  • VOD
    acs:vod:*:{#accountId}:*/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
VideoIdstringYes

The ID of the video.

142710f878bd42508932f660d7b1****
TemplateGroupIdstringYes

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.

0e408c803baf658ee637790c5d9f****
PipelineIdstringNo

The ID of the pipeline.

d3e680e618708erf45fbf2cae7c****
EncryptConfigstringNo

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.
  • {"CipherText":"ZjJmZGViNzUtZWY1Mi00Y2RlLTk3****", "DecryptKeyUri":"http://demo.aliyundoc.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3****","KeyServiceType":"KMS"}
    OverrideParamsstringNo

    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.

    {"Watermarks":[{"WatermarkId":"af2afe4761992c47dae973374****","FileUrl":"http://developer.aliyundoc.com/image/image.png"},{"WatermarkId":"e8e5b8038d7ada85b376c2707****","Content":"watermark test"}]}
    PrioritystringNo

    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.
    NoteThis 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.
    6
    UserDatastringNo

    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.

    NoteThe callback configurations take effect only when you specify an HTTP callback URL and select specific callback events in the ApsaraVideo VOD console.
    {"Extend":{"localId":"****","test":"***"}}

    Response parameters

    ParameterTypeDescriptionExample
    object

    The returned data.

    TranscodeTaskIdstring

    The ID of the transcoding job that was submitted.

    9f4a0df7da2c8a81c8c0408c84****
    RequestIdstring

    The ID of the request.

    E4EBD2BF-5EB0-4476-8829-9D94E1B1****
    TranscodeJobsobject []

    The transcoding jobs.

    NoteThis parameter is not returned for HLS packaging tasks. You must asynchronously receive the transcoding result.
    JobIdstring

    The ID of the job.

    d8921ce8505716cfe86fb112c4****

    Examples

    Sample success responses

    JSONformat

    {
      "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 codeError messageHTTP status codeDescription
    InvalidVideo.NotFoundThe video does not exist.404The error message returned because the video does not exist.
    NoSuchResourceThe specified resource %s does not exist.404The error message returned because the user-related resource does not exist. %s indicates the specific resource information.
    Forbidden.IllegalStatusStatus of the video is illegal.400The error message returned because the video status is invalid. You can transcode a video only in the UploadSucc, Normal, or Checking state.