This topic describes how to configure a normal transcoding template group in the ApsaraVideo VOD console.
Alibaba Cloud ApsaraVideo VOD provides transcoding and container format conversion for audio and video files. Normal transcoding templates can meet your basic requirements for transcoding. You can select container formats and definitions of media files based on your requirements.
ApsaraVideo VOD supports normal transcoding, no transcoding, and Narrowband HDTM transcoding 1.0. For more information about transcoding, see Audio and video transcoding.
- You are charged for transcoding based on the resolution of the transcoded video. Transcoding fees are calculated based on the width and height of the video that may not match the definition that is specified in the transcoding template. For more information about billing, see Media transcoding.
- After you activate ApsaraVideo VOD, the No Transcoding template group is used by default. You cannot modify or delete the No Transcoding template group. If you use the No Transcoding template group for videos in the MP4, Flash Video (FLV), M3U8, MP3, or WEBM formats, the URLs of your videos in Original quality are used for playback. If you use the No Transcoding template for videos in other formats, the videos are considered source files and cannot be played.
Configure normal transcoding templates
- The changes to transcoding settings apply only to newly uploaded videos.
- To avoid transcoding failures, do not modify or delete a template or a template group when a transcoding job is in progress.
- Log on to the ApsaraVideo VOD console.
- In the left-side navigation pane of the ApsaraVideo VOD console, choose . The Transcoding Template Groups page appears.
- Click Create Transcoding Template Group. Then, the Create Transcoding Template Group page appears.
- Click Add Template in the Normal Transcoding Template section. The following table describes the parameters in the normal transcoding template. Note
- You can add up to 10 normal transcoding templates to each transcoding template group. When you use a transcoding template group to transcode a video, a video file is generated for each template in the transcoding template group and you are charged for each transcoded video file. To improve storage utilization and prevent additional costs, we recommend that you create transcoding templates based on your business requirements.
- If you want to use normal transcoding, you need to configure only a normal transcoding template. For more information about video packaging templates, see Configure video packaging templates.
No. Section Parameter Description 1 Basic Parameters Encapsulation Format
- Valid values for video files: hls, mp4, and flv.
- Valid value for audio files: mp3.
For more information about each container format, see Terms.
- Valid values for video files: Low Definition, Standard Definition, High Definition, Ultra High Definition, 2K, 4K, and Original. Note
- For more information about the definition of narrowband HD 1.0 such as LD-Narrowband HD1.0 or SD-Narrowband HD1.0, see Narrowband HD TM 1.0.
- If you set Definition to Original, the original definition and bitrate of videos are retained. Only the container format of videos is modified. This template group is suitable for scenarios in which you do not need to change the size or bitrate of videos.
- Valid values for audio files: Standard Quality and High Quality.
2 Video Parameters Disable Video If you select Disable Video, the transcoded stream does not contain video information. You can select Disable Video to extract audio in scenarios such as radio broadcasts. Encoding Format Valid values: H.264 and H.265. Bitrate (Kbps) Valid values: 10 to 50000. The definition is based on the bitrate. We recommend that you use the recommended bitrate in the following table for each definition. Resolution Valid values: 128 to 4096. Unit: pixels. You can specify the width or height of the video. For example, if you specify the width of the video, the height is automatically calculated based on the original aspect ratio of the video. Frame Rate The number of frames displayed per second. We recommend that you use the recommended value. Maximum Keyframe Interval The number of frames in a group of pictures (GOP). We recommend that you use the recommended value. Watermark Specifies whether to add a watermark to a video. To add a watermark to a video, you must add watermark materials in watermark settings and turn on Watermark. For more information, see Manage watermarks. 3 Audio Parameters Disable Audio If you select Disable Audio, the transcoded stream does not contain audio information. If you want to generate a video stream with no sound, select Disable Audio. Encoding Format If you set Encapsulation Format to hls or mp4, you can set this parameter to AAC or MP3. If you set Encapsulation Format to mp3, you can set this parameter only to MP3. Sample Rate We recommend that you use the recommended value. Bitrate (Kbps) Valid values: 8 to 1000. We recommend that you use the recommended value. Audio Channels We recommend that you use the recommended value. 4 Advanced Parameters. This section is displayed only if you set Encapsulation Format to hls. Fragment Length The duration of each TS segment. We recommend that you use the recommended value. Video Encryption You can enable this feature to encrypt HLS videos. After you enable video encryption, you must integrate an official player SDK that supports video decryption to play videos. A free trial is provided for this feature.Note The video encryption feature that you configure encrypts videos by using Alibaba Cloud proprietary cryptography. For more information, see SubmitTranscodeJobs. 5 Conditional Transcoding Parameters Video Resolution Check Checks whether the resolution of the video file is lower than the resolution that is specified in the transcoding template. Video Bit Rate Check Checks whether the bitrate of the video file is lower than the bitrate that is specified in the transcoding template. Audio Bit Rate Check Checks whether the bitrate of the audio file is lower than the bitrate that is specified in the transcoding template.Conditional transcoding parameters are generally configured when you generate streams in higher definitions. For example, if you set the definition to 4K but the definition of the original video file is lower than 4K, the images are stretched, which lowers the image quality. In this case, you can configure conditional transcoding parameters. The following processing methods are supported:
Definition: The following table describes the recommended bitrates, recommended resolutions, and resolution range for different definitions.
- If the bitrate or resolution specified in the transcoding template is higher than that of the original video file, the video is not transcoded to the specification that is specified in the transcoding template.
- If the bitrate or resolution specified in the transcoding template is higher than that of the original video file, the video is transcoded to the specification that is specified in the transcoding template. However, the bitrate or resolution of the transcoded stream is the same as that of the original video file.
Definition Recommended bitrate Recommended resolution Resolution range LD 400 640×360 128×128~640×360 SD 900 960×540 641×361~960×540 HD 1500 1280×720 961×541~1280×720 UHD 3000 1920×1080 1281×721~1920×1080 2K 3500 2560×1440 1920×1080~2560×1440 4K 6000 3840×2160 2560×1440~3840×2160
- Click Save.
- Optional: On the Transcoding Template Groups page, click Set as Default in the Actions column to set the template group as the default template group.
After you specify a default template group, newly uploaded videos are transcoded based on this transcoding template group.
What to do next
After you create a transcoding template group, you can view, modify, or delete the transcoding template group, or specify the transcoding template group as the default transcoding template group. You cannot view, modify, or delete the No Transcoding template group.