- Transcoding template
- Scenario practices
Video transcoding refers to the process of converting a compressed and encoded video stream to another video stream to adapt to different network bandwidths, terminal processing capabilities, and user needs. Transcoding is essentially a process of decoding and encoding. Streams before and after transcoding may use the same or different video encoding standards.
Audio processing: ApsaraVideo for VOD provides audio processing features such as audio transcoding and audio extraction.
Watermark: ApsaraVideo for VOD supports static image watermarks, dynamic image watermarks (such as GIF and MOV files), and text watermarks. You can add multiple watermarks to the same video. For more information, see the topic about video watermarks.
Multiple preset definitions: ApsaraVideo for VOD provides multiple preset definitions, such as Standard Definition, High Definition, Ultra-High Definition, 2K, and 4K. ApsaraVideo for VOD provides best empirical settings and lowers the requirements on users.
Multi-scenario solutions such as audio extraction: You can extract an audio track of the standard or high quality from videos as audio output. This applies to scenarios such as broadcasting at a radio station.
Content protection: ApsaraVideo for VOD supports content encryption that is applicable in various scenarios such as online education and originality protection.
Adaptation to multiple terminals: generates content that can be played on PCs, TVs, and mobile devices.
Adaptation to multiple network environments: allows you to select the most appropriate bitrate based on your network bandwidth to play videos smoothly.
Reduction of storage and distribution costs: allows you to adjust video bitrates, improve video compression efficiency, and reduce file sizes while ensuring the same image quality. This reduces frame freezing during playback and saves storage space and traffic.
Content protection: supports content encryption that is applicable in various scenarios such as online education and originality protection.
Watermark: allows you to add identification information such as enterprise logos, brand logos, TV station logos, user IDs, and nicknames as watermarks for video copyright declaration or brand promotion.
Based on long-term data analysis, ApsaraVideo for VOD provides multiple scenario-specific preset definitions and streamlines the process from uploading to transcoding.
Some videos such as short videos generally have been compressed when they are captured. They can be directly played on multiple terminals. In this case, you can distribute them without transcoding. For videos that have been transcoded locally, ApsaraVideo for VOD does not need to transcode them again. In this case, you can also distribute these videos without transcoding.
You can directly upload videos in the ApsaraVideo for VOD console, as shown in the following figure. ApsaraVideo for VOD automatically transcodes the uploaded videos based on the specified transcoding template.
You can also specify a transcoding template ID when obtaining an upload credential. After you upload a video by using the upload credential, ApsaraVideo for VOD automatically transcodes the video based on the transcoding template. Then, ApsaraVideo for VOD returns information about the transcoded stream to you based on your callback settings. For more information, see Media upload.
You can also call an operation to specify a transcoding template, and manually initiate transcoding.This operation is often used for re-transcoding existing videos, encrypting existing videos in standard HLS encryption mode, and overriding watermark parameters. For more information, see SubmitTranscodeJobs.
You can also use the no transcoding template to upload videos. In this case, uploaded videos are not transcoded. ApsaraVideo for VOD adds information about the video mezzanine files to the information list of video streams that can be played. You can obtain the playback URLs of the video mezzanine files from the playback information returned by the GetPlayInfo operation. The No Transcoding template is often used for uploading short videos.
Transcoding parameters are often complex. To relieve users of complex parameter management, ApsaraVideo for VOD saves complex parameters as templates. You can customize transcoding templates. A custom transcoding template is a set of transcoding parameters (such as audio, video, and container parameters) that can satisfy your personalized transcoding needs.A transcoding template can generate multiple output streams. In addition, ApsaraVideo for VOD provides recommended parameter settings based on the video definition and audio quality. In this way, users can quickly get started without hard skill requirements.
Note: For more information about the parameter description, see Glossary.
Currently, ApsaraVideo for VOD presets seven video definitions (Low Definition, Standard Definition, High Definition, Ultra-High Definition, 2K, 4K, and Original) and two audio definitions (Standard Quality and High Quality). ApsaraVideo for VOD provides recommended parameter settings for each definition. When you select a definition, ApsaraVideo for VOD automatically sets parameters to recommended values to help you quickly customize a template.
- Encapsulation Format: Currently, HLS, MP4, and FLV are supported for videos, and MP3 is supported for audio.
- For more information about each format, see Container format.
- Video: Low Definition, Standard Definition, High Definition, Ultra-High Definition, 2K, 4K, and Original (used for format conversion)
- Audio: Standard Quality and High Quality
- Disable Video: If you select this check box, the transcoded stream does not contain video information. Generally, you can select this check box to extract audio, for example, in the radio station scenario.
- Encoding Format: Currently, H. 264 and H. 265 are supported.
- Bitrate: Valid values: 10-50000, in kbit/s. The bitrate is used to control the definition. We recommend that you use the recommended value for each definition.
- Resolution: Valid values of the width or height: 128-4096, in pixels. You simply need to set one of the width and height. The other parameter is automatically set based on the aspect ratio of the video mezzanine file.
- Frame Rate: the number of frames per second. We recommend that you use the recommended value for each definition.
- Maximum Keyframe Interval: the number of frames in a GOP. We recommend that you use the recommended value for each definition.
- Watermark: indicates whether to add watermarks to a video. To add watermarks to a video, you must add watermark materials in watermark settings and select this check box. For more information, see Video watermark.
- Disable Audio: If you select this check box, the transcoded stream does not contain audio information. If you want to generate a video stream with no sound, select this check box.
- Encoding Format: Currently, AAC and MP3 are supported for the HLS and MP4 container formats, and MP3 is supported for the MP3 container format.
- Sample Rate: We recommend that you use the recommended value.
- Bitrate: Valid values: 8-1000, in kbit/s. We recommend that you use the recommended value.
- Audio Channels: We recommend that you use the recommended value.
When the container format is set to HLS, the Advanced Parameters area is displayed. In this area, you can set the following parameters:
- Fragment Length: the duration of each TS fragment. We recommend that you use the recommended value.
- HLS Encryption: Currently, the HLS format supports encryption. After you enable HLS encryption, you need to integrate an official playback SDK that supports video encryption to play videos. This service offers free trial. Note: The HLS encryption feature configured here encrypts videos in Alibaba Cloud video encryption mode. To encrypt videos in standard HLS encryption mode, call the SubmitTranscodeJobs operation.
Conditional transcoding is often configured when you want to generate streams in higher definitions. For example, if you set the definition to 4K but the resolution of the video mezzanine file is lower than the specified one, the images are stretched, affecting the video effect. In this case, you can configure conditional transcoding.
- Video Resolution Check: checks whether the resolution of the video mezzanine file is lower than the resolution specified in the transcoding template.
- Video Bit Rate Check: checks whether the bitrate of the video mezzanine file is lower than the bitrate specified in the transcoding template.
- Audio Bit Rate Check: checks whether the bitrate of the audio mezzanine file is lower than the bitrate specified in the transcoding template.
Currently, the following processing methods are supported:
- If the bitrate (or resolution) specified in the transcoding template is higher than that of the video mezzanine file, the video is not transcoded in the specified specifications.
- If the bitrate (or resolution) specified in the transcoding template is higher than that of the video mezzanine file, the video is transcoded in the specified specifications. However, the bitrate (or resolution) of the transcoded stream is the same as that of the video mezzanine file.
ApsaraVideo for VOD provides a special transcoding template, the No Transcoding template.
Videos distributed without transcoding are directly used as video mezzanine files for playback. If this template is used, ApsaraVideo for VOD automatically distributes video mezzanine files and writes the file information to video stream information. When you call the GetPlayInfo operation to obtain playback information, the URLs of the video mezzanine files are returned as playback URLs.This template is often used in scenarios such as short video and live-to-VOD scenarios. You can directly play the video mezzanine files.
Note: The uploaded video mezzanine files must be playable.
The No Transcoding template is activated by default for new users of ApsaraVideo for VOD. If it is not activated, log on to the ApsaraVideo for VOD console, choose Global Settings > Transcoding, and then click Enable for the No Transcoding template.
For more information, see Transcoding settings.
Based on proprietary transcoding technology of Alibaba Cloud, Narrowband HD^TM^1.0 intelligently analyzes each scene, action, content, and texture in videos. It reduces the bitrate and bandwidth cost while ensuring the same video quality.For more information, see the article posted in Yunqi Community.
ApsaraVideo for VOD presets multiple definitions that support Narrowband HD. Narrowband HD transcoding supports the MP4, FLV, and HLS formats. The following table lists the specific parameters.
|Definition||Bitrate range (kbit/s)||Resolution: Width (pixels)|
|Low Definition||≤ 400||640|
|Standard Definition||≤ 800||848|
|High Definition||≤ 1500||1280|
|Ultra-High Definition||≤ 3000||1920|
For more information about the configuration method, see AddTranscodeTemplateGroup. Specify a preset definition to configure Narrowband HD transcoding.
Note: The billing method for Narrowband HD transcoding is different from that for common transcoding. Submit a ticket for consultation.
For more information, see Live-to-VOD transcoding practices.