tencent cloud

Creating Templates
Last updated: 2025-09-09 16:06:22
Creating Templates
Last updated: 2025-09-09 16:06:22

Feature Description

Create a video quality enhancement template.

Authorization Description

When used by a sub-account, the ci:CreateMediaTemplate permission is required. For details, see Cloud Infinite actions.

Activating a Service

Using this feature requires enabling Cloud Infinite in advance and binding a bucket. For details, see Bind Bucket.
Use this feature requires enabling Media Processing Service in advance via console or API. For details, see Enable Media Processing Service.

Use Limits

When using this API, please first confirm the relevant restrictions. For details, see Usage Limits.


Request

Request sample

POST /template HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml

<body>
Note:
Authorization: Auth String. For details, see Request Signature document.

Request header

This API only uses common request headers. For details, see Common Request Headers documentation.

Request body

The implementation of this request operation requires the following request body.
<Request>
<Tag>VideoEnhance</Tag>
<Name>TemplateName</Name>
<VideoEnhance>
<Transcode>
<Container>
<Format>mp4</Format>
</Container>
<Video>
<Codec>H.264</Codec>
<Width>1280</Width>
<Fps>30</Fps>
</Video>
<Audio>
<Codec>aac</Codec>
<Samplerate>44100</Samplerate>
<Bitrate>128</Bitrate>
<Channels>4</Channels>
</Audio>
</Transcode>
<SuperResolution>
<Resolution>sdtohd</Resolution>
<EnableScaleUp>true</EnableScaleUp>
<Version>Enhance</Version>
</SuperResolution>
<ColorEnhance>
<Contrast>50</Contrast>
<Correction>100</Correction>
<Saturation>100</Saturation>
</ColorEnhance>
<MsSharpen>
<SharpenLevel>5</SharpenLevel>
</MsSharpen>
<SDRtoHDR>
<HdrMode>HDR10</HdrMode>
</SDRtoHDR>
<FrameEnhance>
<FrameDoubling>true</FrameDoubling>
</FrameEnhance>
</VideoEnhance>
</Request>
The data are described as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Request
None.
Container for saving requests
Container
Yes
The specific data description for the
Request
Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Tag
Request
Template type: VideoEnhance
String
None.
Yes
Name
Request
Template name: Only supports Chinese, English, digits, _, -, and *, with length not exceeding 64.
String
None.
Yes
VideoEnhance
Request
Video quality enhancement parameters
Container
None.
Yes

The specific data description for the
VideoEnhance
Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Transcode
Request.VideoEnhance
transcoding parameters
Container
None.
Yes
SuperResolution
Request.VideoEnhance
Super-resolution parameters
Container
None.
No
SDRtoHDR
Request.VideoEnhance
SDR to HDR parameters
Container
None.
No
ColorEnhance
Request.VideoEnhance
Color enhancement parameters
Container
None.
No
MsSharpen
Request.VideoEnhance
Detail enhancement parameters
Container
None.
No
FrameEnhance
Request.FrameEnhance
Frame rate enhancement parameters
Container
None.
No
Note:
SuperResolution, SDRtoHDR, ColorEnhance, MsSharpen, FrameEnhance cannot be empty at the same time.
The specific data description of the
Transcode
Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Container
Request.VideoEnhance.Transcode
container format
Container
None.
Yes
Video
Request.VideoEnhance.Transcode
video information
Container
None.
Yes
Audio
Request.VideoEnhance.Transcode
Audio content, omit Audio to equivalent to delete audio content
Container
None.
No
Specific data description for Container type
Container
:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Format
Request.Container
Muxing format: mp4/webm
String
Yes
Specific data description for Container type
Video
:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Codec
Request.VideoEnhance.Transcode.Video
Encoding/decoding format
H.264
H.265
VP8
VP9
String
H.264, VP8 when Format is WebM
No
Width
Request.VideoEnhance.Transcode.Video
Width
Value range: [128, 4096]
unit: px
If only Width is set, calculate Height based on the original aspect ratio of the video.
Must be even
String
When the Request.VideoEnhance.SuperResolution parameter is empty, the default value is the original width of the video.
When the Request.VideoEnhance.SuperResolution parameter is not empty, the default value is twice the original width of the video.
No
Height
Request.VideoEnhance.Transcode.Video
Height
Value range: [128, 4096]
Unit: px
If only Height is set, calculate Width based on the original aspect ratio of the video.
Must be even
String
When the Request.VideoEnhance.SuperResolution parameter is empty, the default value is the original height of the video.
When the Request.VideoEnhance.SuperResolution parameter is not empty, the default value is twice the original height of the video.
No
Fps
Request.VideoEnhance.Transcode.Video
Frame Rate
Value range: (0, 60]
Unit: fps
String
None.
No
The specific data description for the
Audio
Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Codec
Request.VideoEnhance.Transcode.Audio
encoding/decoding format, parameter values aac, mp3, Vorbis, opus
String
aac, when format is WebM, is Vorbis
No
Samplerate
Request.VideoEnhance.Transcode.Audio
sampling rate
unit: Hz
Option 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000
Different encapsulations, MP3 supports different sampling rates, as shown in the table below
When Codec is set to amr, only 8000 is supported
When Codec is set to opus, only 8000, 16000, 24000, and 48000 are supported
String
44100, when the Codec is opus, the default value is 48000
No
Bitrate
Request.VideoEnhance.Transcode.Audio
Original audio bitrate
Unit: Kbps
Value range: [8, 1000]
String
None.
No
Channels
Request.VideoEnhance.Transcode.Audio
Number of sound channels
String
None.
No
Set container. Supported audio/video formats are as shown in the table below:
Container
Audio Codecs
Video Codecs
mp4
aac,mp3
H.264,H.265
WebM
Vorbis,opus
VP8,VP9
Data description for Container type
ColorEnhance
is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Contrast
Request.VideoEnhance.ColorEnhance
Contrast
Value range: [0, 100]
Auto (automatic analysis)
String
None.
Yes
Correction
Request.VideoEnhance.ColorEnhance
Color correction
Value range: [0, 1000]
Auto (automatic analysis)
String
None.
Yes
Saturation
Request.VideoEnhance.ColorEnhance
Saturation
Value range: [0, 300]
Auto (automatic analysis)
String
None.
Yes

The specific data description for the
MsSharpen
Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
SharpenLevel
Request.VideoEnhance.MsSharpen
Enhancement level
Value range: [0, 10]
Auto (automatic analysis)
String
None.
Yes

The specific data description for the Container type
SuperResolution
is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
Resolution
Request.VideoEnhance.SuperResolution
Resolution options
sdtohd: Standard Definition to Ultra High Definition
hdto4k: High Definition to 4K
String
None.
Yes
EnableScaleUp
Request.VideoEnhance.SuperResolution
Auto Scaling switch, value: true, false
String
false
No
Version
Request.VideoEnhance.SuperResolution
Version
Base: Basic Version
Enhance: Enhanced Version
String
Base
No

Data description for Container type
SDRtoHDR
is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
HdrMode
Request.VideoEnhance.SDRtoHDR
HDR standard
HLG
HDR10
String
None.
HLG
HDR10

Data description for Container type
FrameEnhance
is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Default Value
Required or Not
FrameDoubling
Request.VideoEnhance.FrameEnhance
Whether frame interpolation is enabled, parameter values: true, false
String
false
No

Response

Response Headers

This API only returns the public response header. For details, see Common Response Headers documentation.

Response Body

The response body is returned as application/xml. The content of the complete node data is shown as follows:
<Response>
<RequestId>NjJmMWQxYjNfOTBmYTUwNjRfNWYyY18x</RequestId>
<Template>
<Tag>VideoEnhance</Tag>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Name>TemplateName</Name>
<BucketId>test-1234567890</BucketId>
<Category>Custom</Category>
<VideoEnhance>
<transcode>
<Container>
<Format>mp4</Format>
</Container>
<Video>
<Codec>H.264</Codec>
<Bitrate>1000</Bitrate>
<Width>1280</Width>
<Fps>30</Fps>
</Video>
<Audio>
<Codec>aac</Codec>
<Samplerate>44100</Samplerate>
<Bitrate>128</Bitrate>
<Channels>4</Channels>
</Audio>
</Transcode>
<SuperResolution>
<Resolution>sdtohd</Resolution>
<EnableScaleUp>true</EnableScaleUp>
<Version>Enhance</Version>
</SuperResolution>
<ColorEnhance>
<Contrast>50</Contrast>
<Correction>100</Correction>
<Saturation>100</Saturation>
</ColorEnhance>
<MsSharpen>
<SharpenLevel>5</SharpenLevel>
</MsSharpen>
<SDRtoHDR>
<HdrMode>HDR10</HdrMode>
</SDRtoHDR>
<FrameEnhance>
<FrameDoubling>true</FrameDoubling>
</FrameEnhance>
</VideoEnhance>
<CreateTime>2020-08-05T11:35:24+0800</CreateTime>
<UpdateTime>2020-08-31T16:15:20+0800</UpdateTime>
</Template>
</Response>
The data are as follows:
Node Name (Keyword)
Parent Node
Description
Type
Response
None.
Container for saving results
Container
Container node
Response
content:
Node Name (Keyword)
Parent Node
Description
Type
Template
Response
Container for saving template details
Container
RequestId
Response
unique request ID
String
Container node
Template
content:
Node Name (Keyword)
Parent Node
Description
Type
TemplateId
Response.Template
template ID
String
Name
Response.Template
Template Name
String
BucketId
Response.Template
Template's associated bucket
String
Category
Response.Template
Template Properties, Custom or Official
String
Tag
Response.Template
Template type: SuperResolution
String
UpdateTime
Response.Template
Update time
String
CreateTime
Response.Template
Creation time
String
VideoEnhance
Response.Template
Detailed template parameters
Container
Container node VideoEnhance content:
Node Name (Keyword)
Parent Node
Description
Type
Transcode
Response.Template.VideoEnhance
Request.Transcode in the request body
Container
SuperResolution
Response.Template.VideoEnhance
Request.SuperResolution in the request body
Container
SDRtoHDR
Response.Template.VideoEnhance
Request.SDRtoHDR in the request body
Container
ColorEnhance
Response.Template.VideoEnhance
Request.ColorEnhance in the request body
Container
MsSharpen
Response.Template.VideoEnhance
Request.MsSharpen in the request body
Container
FrameEnhance
Response.Template.VideoEnhance
Request.FrameEnhance in the request body
Container

Error Codes

This request returns common error responses and error codes. For more information, see Error Codes.

Examples

Request

POST /template HTTP/1.1
Authorization: q-sign-algorithm=sha1&q-ak=**********************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=**************************************
Host: test-1234567890.ci.ap-chongqing.myqcloud.com
Content-Length: 1666
Content-Type: application/xml

<Request>
<Tag>VideoEnhance</Tag>
<Name>TemplateName</Name>
<VideoEnhance>
<Transcode>
<Container>
<Format>mp4</Format>
</Container>
<Video>
<Codec>H.264</Codec>
<Bitrate>1000</Bitrate>
<Width>1280</Width>
<Fps>30</Fps>
</Video>
<Audio>
<Codec>aac</Codec>
<Samplerate>44100</Samplerate>
<Bitrate>128</Bitrate>
<Channels>4</Channels>
</Audio>
</Transcode>
<SuperResolution>
<Resolution>sdtohd</Resolution>
<EnableScaleUp>true</EnableScaleUp>
<Version>Enhance</Version>
</SuperResolution>
<ColorEnhance>
<Contrast>50</Contrast>
<Correction>100</Correction>
<Saturation>100</Saturation>
</ColorEnhance>
<MsSharpen>
<SharpenLevel>5</SharpenLevel>
</MsSharpen>
<SDRtoHDR>
<HdrMode>HDR10</HdrMode>
</SDRtoHDR>
<FrameEnhance>
<FrameDoubling>true</FrameDoubling>
</FrameEnhance>
</VideoEnhance>
</Request>

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 100
Connection: keep-alive
Date: Thu, 14 Jul 2022 12:37:29 GMT
Server: tencent-ci
x-ci-request-id: NjJmMWQxYjNfOTBmYTUwNjRfNWYyY18x

<Response>
<RequestId>NjJmMWQxYjNfOTBmYTUwNjRfNWYyY18x</RequestId>
<Template>
<Tag>VideoEnhance</Tag>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Name>TemplateName</Name>
<BucketId>test-1234567890</BucketId>
<Category>Custom</Category>
<VideoEnhance>
<transcode>
<Container>
<Format>mp4</Format>
</Container>
<Video>
<Codec>H.264</Codec>
<Bitrate>1000</Bitrate>
<Width>1280</Width>
<Fps>30</Fps>
</Video>
<Audio>
<Codec>aac</Codec>
<Samplerate>44100</Samplerate>
<Bitrate>128</Bitrate>
<Channels>4</Channels>
</Audio>
</Transcode>
<SuperResolution>
<Resolution>sdtohd</Resolution>
<EnableScaleUp>true</EnableScaleUp>
<Version>Enhance</Version>
</SuperResolution>
<ColorEnhance>
<Contrast>50</Contrast>
<Correction>100</Correction>
<Saturation>100</Saturation>
</ColorEnhance>
<MsSharpen>
<SharpenLevel>5</SharpenLevel>
</MsSharpen>
<SDRtoHDR>
<HdrMode>HDR10</HdrMode>
</SDRtoHDR>
<FrameEnhance>
<FrameDoubling>true</FrameDoubling>
</FrameEnhance>
</VideoEnhance>
<CreateTime>2020-08-05T11:35:24+0800</CreateTime>
<UpdateTime>2020-08-31T16:15:20+0800</UpdateTime>
</Template>
</Response>

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback