tencent cloud

文档反馈

CreateTranscodeTemplate

最后更新时间:2024-03-27 16:08:21

    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.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    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 Params. The value used for this API: CreateTranscodeTemplate.
    Version Yes String Common Params. The value used for this API: 2018-07-17.
    Region No String Common Params. This parameter is not required.
    Container Yes String The container format. Valid values: mp4, flv, hls, mp3, flac, ogg, m4a, wav ( mp3, flac, ogg, m4a, and wav are audio file formats).
    SubAppId No Integer The VOD application ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
    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.
    SegmentType No String The segment type. This parameter is valid only if Container is hls. Valid values:
  • ts: TS segment
  • fmp4: fMP4 segment

  • Default: ts

    3. Output Parameters

    Parameter Name Type Description
    Definition Integer Unique ID of transcoding template.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating a transcoding template

    This example shows you how to create a transcoding template.

    Input Example

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateTranscodeTemplate
    <Common request parameters>
    
    {
        "RemoveVideo": "0",
        "Container": "mp4",
        "Name": "Transcoding template 1",
        "AudioTemplate": {
            "SampleRate": "200",
            "Codec": "libfdk_aac",
            "Bitrate": "200"
        },
        "VideoTemplate": {
            "Codec": "libx264",
            "Bitrate": "256",
            "Fps": "45"
        },
        "RemoveAudio": "0"
    }
    

    Output Example

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

    5. Developer Resources

    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
    FailedOperation Operation failed.
    FailedOperation.InvalidVodUser The VOD service is not activated.
    InternalError Internal error.
    InvalidParameter Invalid parameter.
    InvalidParameterValue Incorrect parameter value.
    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.Bitrate Invalid audio/video bitrate.
    InvalidParameterValue.Codec Invalid audio/video codec.
    InvalidParameterValue.Comment Invalid parameter: template description.
    InvalidParameterValue.Container Invalid parameter: container.
    InvalidParameterValue.FillType Invalid parameter: incorrect fill type.
    InvalidParameterValue.Fps Invalid parameter: video frame rate.
    InvalidParameterValue.Height Invalid parameter: height.
    InvalidParameterValue.Name Incorrect parameter value: Name exceeds the length limit.
    InvalidParameterValue.RemoveAudio Incorrect parameter value: RemoveAudio.
    InvalidParameterValue.RemoveVideo Incorrect parameter value: RemoveVideo.
    InvalidParameterValue.Resolution Invalid parameter: incorrect resolution.
    InvalidParameterValue.ResolutionAdaptive Invalid ResolutionAdaptive.
    InvalidParameterValue.TEHDType Incorrect parameter value: TEHD Type is invalid.
    InvalidParameterValue.Type Incorrect Type parameter value.
    InvalidParameterValue.Vcrf Incorrect vcrf.
    InvalidParameterValue.VideoBitrate Invalid parameter: video stream bitrate.
    InvalidParameterValue.VideoCodec Invalid parameter: video stream encoder.
    InvalidParameterValue.Width Invalid parameter: width.
    LimitExceeded.TooMuchTemplate Limit exceeded: The number of templates exceeds the upper limit of 100. If you need more, pleaseSubmit a ticket
    UnauthorizedOperation Unauthorized operation.