Last updated: 2019-12-14 14:17:06


## 1. API Description

API request domain name:

After a transcoding template is created and a template ID is successfully returned, you need to call the CreateLiveTranscodeRule API and bind the returned template ID to the stream.

Transcoding-related document: LVB Encapsulating and Transcoding.

Default API request rate limit: 200 requests/second.

2. Request Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: CreateLiveTranscodeTemplate
Version Yes String Common parameter; the version of this API: 2018-08-01
Region No String Common parameter; optional for this API
TemplateName Yes String Template name, for example, 900 900p. This can be only a combination of letters and numbers.
VideoBitrate Yes Integer Video bit rate
Vcodec No String Video encoding:
h264/h265. h264 by default
Acodec No String Audio encoding:
aac/mp3. Original audio format by default
AudioBitrate No Integer Audio bit rate; 0 by default; value range: 0-500
Description No String Template description
Width No Integer Width; 0 by default.
NeedVideo No Integer Whether to keep the video; 0: no, 1: yes. 1 by default.
NeedAudio No Integer Whether to keep the audio; 0: no, 1: yes. 1 by default.
Height No Integer Height; 0 by default.
Fps No Integer Frame rate; 0 by default.
Gop No Integer Keyframe interval in seconds. Original interval by default
Rotate No Integer Whether to rotate; 0: no, 1: yes. 0 by default.
Profile No String Encoding quality:
baseline/main/high. baseline by default
BitrateToOrig No Integer Whether to not exceed the original bit rate; 0: no, 1: yes. 0 by default.
HeightToOrig No Integer Whether to not exceed the original height; 0: no, 1: yes. 0 by default.
FpsToOrig No Integer Whether to not exceed the original fps; 0: no, 1: yes. 0 by default.

3. Return Parameters

Parameter name Type Description
TemplateId Integer Template ID.
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Request Sample

Input Sample Code
&<Common request parameter>

Output Sample Code

  "Response": {
    "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03"

5. Developer Resources

API Explorer

API Explorer is a tool that provides ease of use in requesting APIs, authenticating identities, generating SDK and exploring APIs in Tencent Cloud environment.

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error
InternalError.ArgsNotMatch For the API that is used for adding transcoding template
InternalError.ConfInUsed The template is in use.
InternalError.ConfNotFound The template does not exist.
InternalError.ConfOutLimit The number of templates exceeds the display.
InternalError.InvalidInput Parameter check failed.
InternalError.NotFound The record does not exist.
InternalError.ProcessorAlreadyExist The transcoding template name already exists.
InternalError.RuleAlreadyExist The rule has already been configured.
InternalError.RuleInUsing The rule is in use.
InternalError.RuleNotFound The rule does not exist.
InternalError.RuleOutLimit The rule exceeds the limit.
InvalidParameter Parameter error
InvalidParameterValue Incorrect parameter value
MissingParameter Missing parameter