tencent cloud

Feedback

Template Configuration

Last updated: 2022-11-23 11:10:05

    With CSS, the original bitrate is used for playback by default. To use a different playback bitrate, you can bind your domain with a transcoding or adaptive bitrate template. This document shows you how to bind a template to and unbind a template from a playback domain.

    Notes

    • A template takes effect about 5-10 minutes after it is bound to a domain.
    • After you specify a transcoding template, the backend will generate playback URLs of different formats for the transcoded stream. To avoid image distortion, push the stream at a resolution as close as possible to the original resolution.
    • H.265 is supported by fewer players than H.264. Playback may fail if a player does not support H.265. To solve this issue, you can configure a transcoding template to transcode your video to H.264.
    • Loading may take some time for the first user accessing the URL that uses a different playback bitrate.
    • One domain can be bound with multiple transcoding templates. After you bind a template, videos will be transcoded as specified in the template.
    • You can create up to 50 transcoding templates.

    Prerequisites

    Transcoding Template

    Binding a transcoding template

    1. Go to Domain Management. Click the name of your playback domain or Manage on the right.
    2. Select the Template Configuration tab and click Edit in the Transcoding Configuration area.
    3. Select a transcoding template. Videos under the current domain will be transcoded using the codec and bitrate specified in the template.
    4. Click Confirm.

    URL format for transcoded streams

    After binding a transcoding template, append its name to your playback URL (playback URL_transcoding template name). If you do not append the template name, the original stream will be played. For more information on playback URLs, see Playback Configuration.

    Suppose the name of the transcoding template bound is hd, and the original playback URL is as follows:

    http://domain/AppName/StreamName.flv?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time) 
    

    To play the transcoded stream, you need to use the following URL:

    http://domain/AppName/StreamName_hd.flv?txSecret=Md5(key+StreamName_hd+hex(time))&txTime=hex(time)
    

    Unbinding a transcoding template

    1. Go to Domain Management. Click the name of your playback domain or click Manage on the right.
    2. Select the Template Configuration tab.
    3. In the Transcoding Configuration area, click Edit on the right and unselect the template you want to unbind.
    4. Click Confirm.
    Note:

    To delete a template, you need to unbind it first and then go to Feature Configuration > Live Transcoding to delete it. For details, see Deleting a Template.

    Adaptive Bitrate Template

    Binding an adaptive bitrate template

    1. Go to Domain Management. Click the name of your playback domain or Manage on the right.
    2. Select the Template Configuration tab and click Edit in the Adaptive bitrate configuration area.
    3. Select an adaptive bitrate template. Streams of different bitrates will be generated for videos under the current domain according to the template.
    4. Click Confirm.

    Adaptive bitrate URL format

    Only HLS and WebRTC are supported for adaptive bitrate playback. The URL formats for the two protocols are different. For details, see Playback Configuration.
    HLS URL
    Suppose the name of the adaptive bitrate template bound is autobitrate, and the original playback URL is as follows:

    http://domain/AppName/StreamName.m3u8?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time) 
    

    To play the transcoded stream, you need to use the following URL:

    http://domain/AppName/StreamName_autobitrate.m3u8?txSecret=Md5(key+StreamName_autobitrate+hex(time))&txTime=hex(time)
    

    WebRTC URL:
    Suppose the adaptive bitrate template bound has three streams. Their names are "test 1", "test 2", and "test 3", and their bitrates are 200 Kbps, 300 Kbps, and 400 Kbps respectively.
    The adaptive bitrate playback URL would be as follows:

    webrtc://domain/AppName/StreamName?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)&tabr_bitrates=test3,test2,test1&tabr_start_bitrate=test1&tabr_control=auto
    

    Unbinding an adaptive bitrate template

    1. Go to Domain Management. Click the name of your playback domain or click Manage on the right.
    2. Select the Template Configuration tab.
    3. In the Adaptive bitrate configuration area, click Edit on the right and unselect the template you want to unbind.
    4. Click Confirm.
    Note:

    To delete a template, you need to unbind it first and then go to Feature Configuration > Live Transcoding to delete it. For details, see Deleting a Template.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support