CreateJustInTimeTranscodeTemplate

1. API Description

Domain name for API request: teo.intl.tencentcloudapi.com.

JIT transcoding already provides preset transcoding templates to meet most needs. If there are personalized transcoding requirements, you can create custom transcoding templates through this API, with up to 100 custom transcoding templates allowed.
This API is used to ensure the consistency of JIT transcoding effect, avoid video output exceptions caused by EO cache or M3U8 sharding template changes during the process, and templates cannot be modified after creation.
This API is used to learn about the detailed capacity of JIT transcoding. EdgeOne video instant processing function introduction (https://www.tencentcloud.comom/document/product/1552/111927?from_cn_redirect=1).

A maximum of 20 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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: CreateJustInTimeTranscodeTemplate.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
ZoneIdYesStringSpecifies the site ID.
TemplateNameYesStringName of the just in time transcoding template, length limited to 64 characters.
CommentNoStringTemplate description, with a length limit of 256 characters. empty by default.
VideoStreamSwitchNoStringEnable video stream. valid values:.
  • on: Enable;


  • off: disabled.
  • default value: on.
    AudioStreamSwitchNoStringEnable audio stream switch. valid values:.
  • on: Enable;


  • off: disabled.
  • default value: on.
    VideoTemplateNoVideoTemplateInfoVideo stream configuration parameters. this field is required when VideoStreamSwitch is on.
    AudioTemplateNoAudioTemplateInfoAudio stream configuration parameters. this field is required when AudioStreamSwitch is on.

    3. Output Parameters

    Parameter NameTypeDescription
    TemplateIdStringUnique identifier of the instant transcoding template for jit transcoding URL concatenation.
    RequestIdStringThe 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 Just-In-Time Transcoding Template

    This example shows you how to create a just-in-time transcoding template.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateJustInTimeTranscodeTemplate
    <Common request parameters>
    
    {
        "ZoneId": "zone-djuqmq",
        "TemplateName": "myTemplate",
        "Comment": "This is my template.",
        "VideoStreamSwitch": "on",
        "AudioStreamSwitch": "on",
        "VideoTemplate": {
            "Codec": "H.264",
            "Bitrate": 2048,
            "Fps": 25
        },
        "AudioTemplate": {
            "Codec": "libfdk_aac",
            "AudioChannel": 2
        }
    }
    

    Output Example

    {
        "Response": {
            "TemplateId": "C1LZ7982VgTpYhJ7M",
            "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 CodeDescription
    FailedOperation.ProductDiscontinuedThe product will already be discontinued. operation denied.
    FailedOperation.ProductNotActivatedThis product is not enabled. please enable it and try again.
    FailedOperation.TemplateOverLimitThe number of templates under this site exceeds the maximum quantity limit.
    InternalErrorInternal error.
    InvalidParameterValueInvalid parameter value.
    InvalidParameterValue.ZoneNotFoundNo corresponding site. please ensure correct information entry.
    InvalidParameterValue.ZonePausedThe site is disabled. check current site status.
    MissingParameterMissing parameters.
    UnauthorizedOperationUnauthorized operation.