CreateTranscodeTemplate

Last updated: 2020-03-27 18:45:38

1. API Description

Domain name for API request: vod.tencentcloudapi.com.

This API is used to create a custom transcoding template. Up to 100 templates can be created.

A maximum of 100 requests can be initiated per second for this API.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: CreateTranscodeTemplate.
Version Yes String Common parameter. The value used for this API: 2018-07-17.
Region No String Common parameter. This parameter is not required for this API.
Container Yes String Container. Valid values: mp4; flv; hls; mp3; flac; ogg; m4a. Among them, mp3, flac, ogg, and m4a are for audio files.
Name No String Transcoding template name. Length limit: 64 characters.
Comment No String Template description. Length limit: 256 characters.
RemoveVideo No Integer Whether to remove video data. Valid values:
  • 0: retain
  • 1: remove

  • Default value: 0.
    RemoveAudio No Integer Whether to remove audio data. Valid values:
  • 0: retain
  • 1: remove

  • Default value: 0.
    VideoTemplate No VideoTemplateInfo Video stream configuration parameter. This field is required when RemoveVideo is 0.
    AudioTemplate No AudioTemplateInfo Audio stream configuration parameter. This field is required when RemoveAudio is 0.
    TEHDConfig No TEHDConfig TESHD transcoding parameter.
    SubAppId No Integer Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.

    3. Output Parameters

    Parameter Name Type Description
    Definition Integer Unique ID of transcoding template.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Creating a transcoding template

    Input Example

    https://vod.tencentcloudapi.com/?Action=CreateTranscodeTemplate
    &Container=mp4
    &Name=Transcoding template 1
    &RemoveVideo=0
    &RemoveAudio=0
    &VideoTemplate.Codec=libx264
    &VideoTemplate.Fps=45
    &VideoTemplate.Bitrate=256
    &AudioTemplate.Codec=libfdk_aac
    &AudioTemplate.Bitrate=200
    &AudioTemplate.SampleRate=200
    &<Common request parameters>

    Output Example

    {
      "Response": {
        "Definition": 1008,
        "RequestId": "12ae8d8e-dce3-4151-9d4b-5594145287e1"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError Internal error.
    InvalidParameterValue.AudioBitrate Invalid parameter: audio stream bitrate.
    InvalidParameterValue.AudioChannel Incorrect parameter value: AudioChannel.
    InvalidParameterValue.AudioCodec Invalid parameter: audio stream encoder.
    InvalidParameterValue.AudioSampleRate Invalid parameter: audio stream sample rate.
    InvalidParameterValue.Container Invalid parameter: container.
    InvalidParameterValue.FillType Invalid parameter: incorrect fill type.
    InvalidParameterValue.Fps Invalid parameter: video frame rate.
    InvalidParameterValue.RemoveAudio Incorrect parameter value: RemoveAudio.
    InvalidParameterValue.RemoveVideo Incorrect parameter value: RemoveVideo.
    InvalidParameterValue.Resolution Invalid parameter: incorrect resolution.
    InvalidParameterValue.TEHDType Incorrect parameter value: TEHD Type is invalid.
    InvalidParameterValue.VideoBitrate Invalid parameter: video stream bitrate.
    InvalidParameterValue.VideoCodec Invalid parameter: video stream encoder.
    LimitExceeded.TooMuchTemplate Limit exceeded: the number of templates exceeds the limit.
    UnauthorizedOperation Unauthorized operation.