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 provides a built-in No Transcoding template group. After you activate ApsaraVideo VOD, the No Transcoding template group is used by default. If you use the No Transcoding template group, the URLs of your videos in Original quality are used. Only videos in the following formats can be played without transcoding: MP4, Flash Video (FLV), M3U8, MP3, and WEBM.

ApsaraVideo VOD supports normal transcoding, no transcoding, and Narrowband HDTM transcoding 1.0. For more information about transcoding, see Audio and video transcoding.

Notice 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, which may not match the definition that is specified in the transcoding template. For more information, see Billing of basic services.

Configure normal transcoding templates

Notice
  • 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.
  1. Log on to the ApsaraVideo VOD console.
  2. In the left-side navigation pane of the ApsaraVideo VOD console, choose Configuration Management > Media Processing > Transcoding Template Groups. The Transcoding Template Groups page appears.
  3. Click Create Transcoding Template Group. Then, the Create Transcoding Template Group page appears.
  4. 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 every transcoded video file. To improve storage utilization and prevent unnecessary costs, we recommend that you create transcoding templates based on your needs.
    • If you need only basic transcoding features, configure only the Normal Transcoding Template. For more information about the Video Packaging Template, see Configure video packaging templates.
    Normal transcoding
    Item Category 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 encapsulation format, see Terms.

    Definition
    • 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 adjust 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, in 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 often configured when you want to 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:
    • 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 template specifications.
    • 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 template specifications. However, the bitrate or resolution of the transcoded stream is the same as that of the original video file.
    Definition: The following table describes the recommended bitrates, recommended resolutions, and resolution range for different definitions.
    Definition Recommended bitrate Recommended resolution Resolution range
    Low definition 400 640×360 128×128~640×360
    Standard definition 900 960×540 641×361~960×540
    High definition 1500 1280×720 961×541~1280×720
    Ultra high definition 3000 1920×1080 1281×721~1920×1080
    2K 3500 2560×1440 1920×1080~2560×1440
    4K 6000 3840×2160 2560×1440~3840×2160
  5. Click Save.
  6. 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, edit, 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.

On the Transcoding Template Groups page, you can click View and Edit to view and modify the configurations of a transcoding template group. You can also click Delete to delete a transcoding template group that you no longer need. Modification of normal transcoding templates