Overview
Menu

Audio/Video Transcoding Integration

Last updated: 2025-06-19 16:37:13Download PDF

I. Audio/Video Transcoding Feature Overview

Overview

Audio/video transcoding is the process of converting the original audio/video bitrate stream into another audio/video bitrate stream, and it is an offline task. Through transcoding, parameters such as the encoding format, resolution, and bitrate of the original bitrate stream can be changed to adapt to playback on different terminals and in different network environments. For an explanation of various types of transcoding, see the table below.
Applicable Input Source
Transcoding Type
Description


Video
Standard video transcoding
It can reduce the video bitrate and change the parameters of the original bitrate stream such as the encoding standard, resolution, and frame rate, thereby adapting to playback on different terminals and in different network environments.
TSC transcoding
Top speed codec (TSC) transcoding is an "upgraded" feature of standard video transcoding. It can perform adaptive optimization processing on different types of videos, delivering higher-definition viewing experiences to users with lower bandwidth consumption. While maintaining or even enhancing the image quality, it reduces bandwidth costs by more than 50%.
Adaptive bitrate stream for videos
Convert the input source video file into multiple bitrate streams suitable for playback in different scenarios, allowing users to select a video with a suitable bitrate for playback based on their network conditions, thereby enhancing the user experience.
Remux
It can change the encapsulation format of the source video file.
Audio
Standard audio transcoding
It can reduce the audio bitrate and change parameters such as the encoding standard, sampling rate, and sound channel, thereby adapting to playback on different terminals and in different network environments.
TSC transcoding for audio
TSC transcoding for audio is an "upgraded" feature of standard audio transcoding. It can perform adaptive optimization processing on different types of audio, delivering higher-definition listening experiences to users with lower bandwidth consumption.
Adaptive bitrate stream for audio
It can convert the input source audio file into multiple bitrate streams suitable for playback in different scenarios, thereby adapting to different network conditions and enhancing the user experience.

Technical Strengths

Within the industry, Tencent Cloud MPS supports the most comprehensive audio/video encoding standard compression. It provides multiple transcoding methods such as TSC transcoding, adaptive bitrate stream transcoding, Remux, and audio transcoding. With distributed transcoding supporting up to 30+ times speed, it helps reduce playback bandwidth consumption and costs.
Comprehensive Encoding Method, Reducing the Bitrate by More Than 50%
Provide comprehensive encoding methods (such as VP8, H.264, VP9, H.265, AV1, AVS3, and H.266), which can significantly reduce the bitrate without quality loss, saving playback bandwidth and storage costs.
Superior Image Quality and Crystal-Clear View
By using intelligent dynamic encoding technology, TSC delivers a superior viewing effect while reducing the bitrate. Compared to open-source encoders, the VMAF score increases by 3 to 5 points. It supports real-time encoding for high-resolution videos up to 8K, integrating advanced technologies such as super-resolution, HDR, and expanded color gamut. Moreover, it was one of the first in China to support Dolby Vision/Dolby Atoms, providing an exceptionally clear viewing experience.


Note:
Open MPS Demo, where you can quickly experience the effects of the audio/video transcoding feature.

How to Use the Audio/Video Transcoding Feature

(1) Precautions Before Use

Before using the audio/video transcoding feature, you need to complete the following preliminary operations: registration/login for a Tencent Cloud account; activation and authorization of the COS service. For a specific operation guide, see Getting Started. For account authorization issues, see Account Authorization.

(2) Creating Audio/Video Transcoding Tasks

Tencent Cloud MPS provides three task initiation methods: quickly creating tasks through the console, initiating tasks through the API, and automatically triggering tasks. The following flowchart shows the general operation process for each task initiation method. To learn about the specific configuration methods for audio/video transcoding tasks, see the detailed instructions in the Creating Audio/Video Transcoding Tasks section below.


II. Creating Audio/Video Transcoding Tasks

Method 1. Initiating a Zero-Code Task from the Console

1. Go to the Media Processing Service console, and then click Create Task > Create VOD Processing Task.

2. First, specify the input video file. You can select audio/video files from a COS or AWS S3 bucket, or provide a file download URL.
3. Then, in the step "Select Input File", add a Audio/Video Transcoding node.

4. In the Audio/Video Enhancement Settings pop-up window, select the required audio/video transcoding template or custom transcoding parameters. For detailed template parameter configuration instructions, see Audio/Video Transcoding Template.

5. Finally, after specifying the output video storage path, click Create to initiate the task.


Method 2. Initiating a Task via the API

Method (1): Call the ProcessMedia API to initiate a task by specifying the Template ID. Example:
{
"InputInfo": {
"Type": "URL",
"UrlInputInfo": {
"Url": "https://test-1234567.cos.ap-guangzhou.myqcloud.com/video/test.mp4"// Replace it with the video URL to be processed.
}
},
"OutputStorage": {
"Type": "cos",
"CosOutputStorage": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou"
}
},
"MediaProcessTask": {
"TranscodeTaskSet": [
{
"Definition": 100800//100800 is the preset template ID for video transcoding. It can be replaced with your custom audio/video transcoding template ID.
}
]
}
}
Method (2): Call the ProcessMedia API to initiate a task by specifying the Orchestration ID (for orchestration creation instructions, see the Automatic Trigger section below or see the VOD Orchestration documentation). Example:
{
"InputInfo": {
"Type": "COS",
"CosInputInfo": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou",
"Object": "/video/123.mp4"
}
},
"OutputStorage": {
"Type": "cos",
"CosOutputStorage": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou"
}
},
"ScheduleId": 12345 //Replace it with a custom orchestration ID. 12345 is a sample code and has no practical significance.
}
It is recommended to use API Explorer for quick debugging and verification:
Enter the online debugging page of the MPS API Explorer, and select the ProcessMedia API from the API list on the left. See the figure below to fill in parameters such as the input path, output path, template ID, and orchestration ID, and then you can initiate the online API call.


Appendix: Additional Parameters for Transcoding-Related APIs

Some advanced features are not available for configuration on the Create a Transcoding Template Through the Console page. You can use the API to CreateTranscodeTemplate and pass in additional parameters through StdExtInfo.

Supplementing Audio Streams with Silence Packets

Parameter Name
Requirement
Type
Remarks
enable_mute _audio
Optional.
Int
It if is enabled, silence packets will be supplemented. The default value is 0.
0: Do not enable.
1: Fill with silence packets when audio frames are discontinuous.
2: On the basis of 1, supplement silence packets for cases where there is no audio at the end.
Example JSON:
"StdExtInfo" : "{\"audio_info\":{\"enable_mute_audio\":1}}"

Transcoding Output File Storage Method

The console supports configuring COS and AWS S3 as output paths. You can also use additional parameters to upload transcoding output files to other third-party cloud storage.
Parameter Name
Requirement
Type
Remarks
appid
Optional.
String
Cloud account ID.
bucket
Required
String
Bucket name.
region
Required
String
Bucket region name.
headers
Optional.
JSON structure
It is of type JSON structure, indicating the headers carried when you upload files. Example:
"headers": {
"agent" : "tencent",
"used" : "for-test"
}
token
Optional.
String
Upload and download using the temporary token method.
id
Optional.
String
User SecretID.
key
Optional.
String
User SecretKey.
host
Optional.
String
host
access_point
Optional.
string
aws_vpc type is required.
storage_type
Optional.
String
"aws_s3": AWS S3.
"aws_vpc": AWS private cloud.
"oss": Alibaba Cloud OSS.
The example JSON is as follows:
"StdExtInfo" : "{\"cos_info\":{\"storage_type\":\"oss\",\"bucket\":\"test-test\",\"region\":\"cn-shenzhen\",\"id\":\"abcdefghijk\",\"key\":\"lmnopqrstuvwxyz\"}}"

Method 3. Automatically Triggering an MPS Task After a File Is Uploaded to COS

If you want to upload a video file to the COS bucket and achieve automatic audio/video transcoding according to preset parameters, you can:
1. Click Save the Orchestration when creating a task, and configure parameters such as the triggered bucket and triggered directory in the pop-up window.

2. Then, go to the VOD Orchestration list, find the new orchestration, and enable the switch at Enable. Subsequently, any video files added to the triggered directory will automatically initiate tasks according to the preset process and parameters of the orchestration, and the processed video files will be saved to the output path configured in the orchestration.
Note:
It takes 3-5 minutes for the orchestration to take effect after being enabled.


III. Querying Task Results

1. Task Callback

When initiating an MPS task using ProcessMedia, you can set callback information through the TaskNotifyConfig parameter. After the task processing is completed, the task result will be callback through the configured callback information. You can parse the event notification result through ParseNotification.

2. Querying Task Results

(Method 1) Querying Task Results by Calling the DescribeTaskDetail API:

Enter the TaskId returned by ProcessMedia (for example, 24000022-WorkflowTask-b20a8exxxxxxx1tt110253) to query task results.


(Method 2) Querying Task Results in the Console:

1. Go to the VOD Processing Tasks console, and the task you just initiated will be listed in the task list.

2. When the subtask is in the "Successful" status, you can navigate to COS Bucket > Output Bucket, find your output location, and then preview or download the audio/video transcoding output files.


IV. Instructions for More Transcoding-Related Features

Watermarking

When creating a transcoding task, you can watermark it.
When initiating a transcoding task in the console, you can follow the following steps to watermark it:

When initiating a task using the API, you can see the following example:
{
"InputInfo": {
"Type": "URL",
"UrlInputInfo": {
"Url": "https://test-1234567.cos.ap-guangzhou.myqcloud.com/video/test.mp4" // Replace it with the video URL to be processed.
}
},
"OutputStorage": {
"Type": "cos",
"CosOutputStorage": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou"
}
},
"MediaProcessTask": {
"TranscodeTaskSet": [
{
"Definition": 100800,//100800 is the preset template ID for video transcoding. It can be replaced with your custom audio/video transcoding template ID.
"WatermarkSet": [
{
"Definition": 12345//Replace it with a watermark template ID. 12345 is a sample code and has no practical significance.
}
]
}
]
}
}

Audio/Video Enhancement

When transcoding, you can choose whether to use the audio/video enhancement feature. For detailed integration instructions, see Audio/Video Enhancement Integration Tutorial.
When using the API, you can enable the enhancement feature by configuring the EnhanceConfig parameter during transcoding template creation:

The example JSON is as follows:
{
"Container": "mp4",
"Name": "test",
"VideoTemplate": { //Video transcoding parameter configuration.
"Codec": "h264",
"Fps": 50,
"Bitrate": 5000,
"Width": 0,
"Height": 0,
"Gop": 0
},
"AudioTemplate": { //Audio transcoding parameter configuration.
"Codec": "aac",
"Bitrate": 60
},
"EnhanceConfig": { //Enhancement parameter configuration.
"VideoEnhance": { //Video enhancement configuration.
"FrameRate": { //Frame interpolation.
"Switch": "ON",
"Fps": 50
},
"SuperResolution": { //Super resolution.
"Switch": "ON",
"Type": "lq"
}
},
"AudioEnhance": { //Audio enhancement configuration.
"Denoise": { //Audio denoising.
"Switch": "ON"
}
}
}
}

On-demand Processing Solution

While providing high-quality transcoding features, Tencent Cloud's audio and video services offer enhancements and on-demand "Quality Inspection + Transcoding & Enhancement". For usage scenarios targeting cost optimization, a quality inspection process can be performed on the video source before the execution of the transcoding process. Then, based on the quality inspection results, a targeted transcoding template can be selected. For detailed methods of integrating media quality inspection, see the Media Quality Inspection Integration documentation.

FAQs

How to Achieve a Higher Compression Rate?

In addition to setting normal encoding parameters such as bitrate and CRF, we recommend using the extreme compression template in TSC (which contains preset templates for various scenarios) to experience higher compression and better image quality.

How to Improve the Image Quality for Optimal Results?

If there are further requirements for image quality, it is recommended to use the audio/video enhancement feature, which can significantly improve the image quality and has various capabilities such as comprehensive enhancement, face enhancement, artifacts removal, color enhancement, super-resolution, intelligent frame interpolation, and large models. For detailed integration instructions, see Audio/Video Enhancement Integration Tutorial.

Whether Object Storage of Other Platforms Can Be Configured as the Output File Storage Path for Transcoding?

Yes. The object storage path of other platforms can be configured through the additional parameter StdExtInfo. For details, see the section Appendix: Additional Parameters for Transcoding-Related APIs above.

Whether External Subtitle Files Can Be Compressed and Rendered into Video Frames?

Yes. When initiating a transcoding task by calling the ProcessMedia API, you can specify the subtitle file through the SubtitleTemplate field. Supported subtitle types include:
SRT, WebVTT, ASS, SSA, and PGS.
Example JSON of ProcessMedia:
{
"MediaProcessTask": {
"TranscodeTaskSet": [
{
"Definition": 100040, //Transcoding template ID. It should be replaced with the transcoding template you need.
"OverrideParameter": { //Overwriting parameters that are used for flexibly overwriting some parameters in the transcoding template.
"SubtitleTemplate": { //Subtitle application configuration.
"Path": "https://test-1234567.cos.ap-nanjing.myqcloud.com/mps_autotest/subtitle/1.vtt", //Subtitle file path.
"StreamIndex": 2,
"FontType": "simkai.ttf",
"FontSize": "10px",
"FontColor": "0xFFFFFF",
"FontAlpha": 0.9
}
}
}
]
},
"InputInfo": { //Enter video information.
"Type": "URL",
"UrlInputInfo": {
"Url": "https://test-1234567.cos.ap-nanjing.myqcloud.com/mps_autotest/subtitle/123.mkv"
}
},
"OutputStorage": { //Output bucket.
"Type": "COS",
"CosOutputStorage": {
"Bucket": "test-1234567",
"Region": "ap-nanjing"
}
},
"OutputDir": "/mps_autotest/output2/", //Output path.
"Action": "ProcessMedia",
"Version": "2019-06-12"
}

Whether External Subtitles Are Supported?

When using an adaptive bitrate stream for videos, you can specify external subtitle files through the AddOnSubtitles field to generate multi-bitrate HLS with subtitles. Example JSON of ProcessMedia:
{
"InputInfo": { //Enter video information.
"Type": "COS",
"CosInputInfo": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou",
"Object": "/test/subtitleinput/test.mp4"
}
},
"OutputStorage": { //Output bucket.
"Type": "COS",
"CosOutputStorage": {
"Bucket": "cg-1308104797",
"Region": "ap-guangzhou"
}
},
"OutputDir": "/yunaMPStest/abroutput/", ////Output path.
"MediaProcessTask": {
"AdaptiveDynamicStreamingTaskSet": [ //Adaptive bitrate stream configuration.
{
"Definition": 1414064, //Adaptive bitrate stream template ID.
"AddOnSubtitles": [ //External subtitle configuration.
{
"Type": "subtitle-stream",
"Subtitle": {
"Type": "COS",
"CosInputInfo": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou",
"Object": "/test/subtitleinput/chs.srt"
}
},
"SubtitleName": "chs"
},
{
"Type": "subtitle-stream",
"Subtitle": {
"Type": "COS",
"CosInputInfo": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou",
"Object": "/test/subtitleinput/cht.srt"
}
},
"SubtitleName": "cht"
},
{
"Type": "subtitle-stream",
"Subtitle": {
"Type": "COS",
"CosInputInfo": {
"Bucket": "test-1234567",
"Region": "ap-guangzhou",
"Object": "/test/subtitleinput/eng.srt"
}
},
"SubtitleName": "eng"
}
]
}
]
}
}

Billing Overview

Tencent Cloud Media Processing (MPS) audio/video transcoding service adopts a billing model based on output file duration. It supports multiple processing types such as standard transcoding, Remux, TSC transcoding, audio-only transcoding, and off-peak transcoding. For the complete explanation of various types of billing rules, see Audio/Video Transcoding Billing.