All Products
Search
Document Center

Intelligent Media Services:Template management

Last Updated:Aug 21, 2026

Transcoding templates are predefined sets of processing parameters that simplify transcoding task creation. Each template has a unique ID and can be used for standard transcoding, subtitle embedding, and watermarking.

Transcoding templates

Standard transcoding

Video transcoding converts a compressed stream into another stream to adapt to different terminals and network bandwidth. This decoding-and-re-encoding process may use the same or different video encoding standards before and after conversion.

IMS supports the following standard transcoding methods.

Method

Description

Scenario

Regular transcoding

Converts media files between multiple formats. You can choose container formats such as MP4, AVI, and MKV, and set resolutions for various playback devices.

Formatting long video content

Audio transcoding

Converts audio file formats, extracts audio streams from video files, and enhances audio effects.

Converting audio files to different formats, adjusting audio quality parameters, or extracting audio from videos to ensure playback compatibility, optimize storage, and facilitate content production

Container format conversion

Converts the container format of videos without changing the resolution or bitrate.

Maintaining the image size or bitrate of the videos

Subtitle

A subtitle template embeds subtitles directly into a video rather than storing them as an external file, which improves playback compatibility and user experience.

Watermark

You can add images or text as watermarks to a video stream during transcoding. Typical watermarks include enterprise or brand logos, TV station logos, and user IDs or nicknames for copyright protection or brand promotion.

IMS supports the following watermark types.

Watermark type

Description

Image watermark

You can upload a PNG or GIF image. An image watermark can appear at a specific position throughout the video or only during a time range that you specify.

Text watermark

You can add one or more text watermarks to videos, configuring properties such as font, font size, color, transparency, and outline. Different text content can be applied to different videos.

Note
  • If files are used as dynamic image watermarks, the file name extensions, such as GIF, must be in lowercase. This does not apply to static image watermarks.

  • Watermark files and the target video must be stored on the same origin server. For example, videos stored on an origin server in the Singapore region can use only watermarks from the same origin server in the Singapore region. For more information about how to add or configure storage addresses in a region, see Configure a storage address.

Create a transcoding template

Use the IMS console

  1. Log on to the IMS console.

  2. In the left-side navigation pane, choose VOD Media Processing > Template Management.

  3. In the top navigation bar, select the desired region from the drop-down list next to the Workbench button.

  4. On the Transcoding tab, create a template based on your business requirements.

    Standard transcoding template

    In the Basic Parameters section, you can specify a transcoding template name, transcoding type, and container format. Regular transcoding, audio transcoding, and container format conversion are supported. The configurable parameters vary by transcoding type.

    image

    Regular transcoding

    Configure video parameters

    image

    Note

    Configurable parameters vary by container format. The parameters in the IMS console prevail.

    Parameter

    Description

    Encoding Format

    Select the encoding format that you want to use. H.264 and H.265 are supported.

    Bitrate Control

    1. Controls the output file bitrate during video encoding. Select a mode from the drop-down list:

      • Bitrate of Input Video: The original video bitrate is used.

      • Fixed Bitrate: The bitrate of the output video is fixed regardless of whether a scene is complex or simple. If you select Fixed Bitrate, the size of the output video is large.

      • Average Bitrate: The average bitrate of the output video is fixed. The bitrate of each scene varies based on the complexity of the scene. More bits are allocated to complex scenes and fewer bits are allocated to simple scenes. This ensures that the bitrate of the output video is within the expected range and that bits are appropriately allocated.

      • CRF: The bitrate of the output video varies based on the quality of the output video. You can specify an integer in the range of 0 to 51 to control the quality of the output video. A value of 0 specifies a lossless output. A value of 51 specifies an output of the worst quality possible. The constant rate factor (CRF) ensures that the quality of the output video is stable. However, the bitrate of the output video varies based on the complexity of the scene and is unpredictable.

    2. Configure the parameters related to the bitrate.

    Peak Bitrate

    The maximum bitrate. Valid values: 10 to 50000. Unit: Kbit/s.

    Bitrate Check

    Optional. The transcoding method used when the bitrate of the input video is lower than the specified bitrate.

    Resolution

    Note

    If your input videos contain landscape and portrait videos, we recommend that you select Set by Long and Short Sides to prevent image distortion.

    Determines the output video size. Select a value based on your requirements and input video characteristics.

    • Resolution of Input Video: The original resolution of the input video is used.

    • Set by Long and Short Sides: The resolution is set based on the long or short side of the video. This method automatically adapts to videos in landscape and portrait modes to prevent image distortion.

    • Set by Width and Height: Specify the width and height of the output video. The horizontal side is the width and the vertical side is the height, regardless of the screen orientation.

    Resolution Check

    Required when Resolution is set to Set by Long and Short Sides or Set by Width and Height. Specifies the transcoding method when the resolution of the original video is smaller than the specified resolution. Valid values:

    • Transcode Based on Resolution of Input Video: Transcoding is performed based on the actual resolution of the original video.

    • Transcode Based on Specific Resolution: Transcoding is performed based on the specified resolution.

    • Do Not Transcode: Use the original video without transcoding.

    Frame Rate

    The number of frames displayed per second. Valid values:

    • Frame Rate of Input Video: Use the frame rate of the input video. If the frame rate of the input video exceeds 60, the output is capped at 60 fps.

    • Custom Frame Rate: Specify an integer value between 0 and 60. Unit: fps. Common values: 15, 25, and 30.

    Advanced Parameters

    Segment Length

    Enter an integer. Valid values: 1 to 60. Unit: seconds.

    Note

    Each segment should contain at least one keyframe. Set the segment duration to a multiple of the group of pictures (GOP) value. If the segment duration is less than the GOP value or is not a multiple of it, the GOP value is adapted during transcoding.

    GOP

    Valid values: Maximum Time Interval between Keyframes and Maximum Number of Frames between Keyframes. Specify the maximum interval between keyframes. You must enter an integer. Valid values: 1 to 100000. Unit: seconds.

    Note

    A greater GOP value indicates a higher compression ratio, a lower encoding speed, a longer duration of a single segment, and a longer response time to seeking.

    Encoding Profile

    Required only when Encoding Format is set to H.264. Valid values: For High-Resolution Devices, For Standard-Resolution Devices, and For Mobile Devices. Different devices support different encoding profiles.

    • If you want to play the output video in multiple definitions, we recommend that you select For Mobile Devices (baseline profile) to ensure normal playback on low-end devices.

    • For High-Resolution Devices specifies the high profile and For Standard-Resolution Devices specifies the main profile.

    Buffer

    Enter an integer. Valid values: 1000 to 128,000. Unit: Kbit/s.

    Note

    The buffer size is used to control the bitrate fluctuation. A larger buffer size indicates a greater fluctuation in the bitrate and higher video quality.

    Scan Mode

    Select the scan mode of the output video. Valid values: Scan Mode of Input Video, Automatic Deinterlacing, Interlaced Scan, and Sequential Scan.

    Note
    1. If you set Scan Mode to Sequential Scan or Interlaced Scan but this scan mode does not match that of the input video, the video fails to be transcoded.

    2. We recommend that you set this parameter to Scan Mode of Input Video or Automatic Deinterlacing for higher compatibility.

    HDR of Source Video

    Sets the dynamic range for an HDR source video after transcoding. To play HDR videos as expected, your display devices and players must support HDR. Otherwise, issues such as overexposure and color cast may occur during playback.

    • SDR Mapping: converts an HDR video to an SDR video compatible with general devices, preserving the color saturation of the source video as much as possible.

      Note

      The service is in public preview and is free of charge. After the public preview ends, you are billed for using the service by minute.

    • Constant HDR: preserves the dynamic range of the source video.

    Color Format

    Select a pixel format for encoding. By default, the original format is used.

    Configure audio parameters

    image

    Parameter

    Description

    Disable Audio

    When enabled, the output file excludes the audio stream and corresponding audio information. Use this to extract only the video stream from a file.

    Encoding Format

    Select an encoding format. Available formats depend on the container format. The options in the IMS console prevail.

    Note
    • If you set the parameter to AC3 or EAC3, the audio effect is converted to Dolby. You can use ApsaraVideo Player SDK to enable exclusive audio effects on Dolby devices. You are charged for Dolby conversion based on the corresponding billing rules.

    • If you want to play HLS videos on web pages, we recommend that you set the parameter to AAC. Other audio formats may not be supported by the web browsers, resulting in the video playing without sound.

    Encoding Profile

    The encoding profile of the output audio. Displayed only when Encoding Format is set to AAC.

    • If the input audio uses the surround sound format such as 5.1 or 7.1, we recommend that you set this parameter to aac_low.

    • If you want to play the output audio on general playback devices, we recommend that you set this parameter to aac_he. Compared with aac_low, this profile can achieve the same audio quality at half the bitrate. A common low bitrate is 64 Kbit/s.

    • If you want to play the output audio on high-end playback devices, we recommend that you set this parameter to aac_he_v2. This way, audio files are encoded in smaller sizes and have higher sound quality. Common low bitrates range from 32 Kbit/s to 48 Kbit/s.

    Sampling Rate

    Select a sampling rate from the drop-down list. Unit: Hz. The supported sampling rates vary based on the encoding format or container format. For more information, see Supported sample rates.

    Audio Bitrate

    Valid values: Bitrate of Input Audio and Average Bitrate.

    • Bitrate of Input Audio: The original bitrate of the input audio is used.

    • Average Bitrate: Set an average bitrate for the output audio.

      Note

      The value must be a multiple of 8 within the range of 8 to 160. We recommend that you set this parameter to 64 or 128. Unit: Kbps.

    Bitrate Check

    Required when Audio Bitrate is set to Average Bitrate. Specifies the transcoding method when the bitrate of the input audio is lower than the specified bitrate. Valid values:

    • Transcode Based on Bitrate of Input Audio: The actual bitrate of the original audio is used for transcoding.

    • Transcode Based on Specific Bitrate: The audio is re-encoded based on the specified average bitrate.

    • Do Not Transcode: The original audio is used without transcoding.

    Sound Channels

    Select the number of sound channels. You can select Audio Channels of Input Audio. Default value: 2.

    Volume Normalization

    Automatically adjusts audio volume to ensure consistency across files with different volume levels. Supported only for a single output audio stream. Unavailable when multiple audio streams are configured.

    Note

    Volume Normalization Professional Edition provides more natural and accurate volume control and is billed based on the processing duration. The service is suitable for applications that require higher audio quality. For more information, see Audio and video enhancement fees.

    Audio transcoding

    Configure audio parameters

    image

    Parameter

    Description

    Disable Audio

    When enabled, the output file excludes the audio stream and corresponding audio information. Use this to extract only the video stream from a file.

    Encoding Format

    Select an encoding format. Available formats depend on the container format. The options in the IMS console prevail.

    Note
    • If you want to play HLS videos on web pages, we recommend that you set the parameter to AAC. Other audio formats may not be supported by the web browsers, resulting in the video playing without sound.

    Encoding Profile

    The encoding profile of the output audio. Displayed only when Encoding Format is set to AAC.

    • If the input audio uses the surround sound format such as 5.1 or 7.1, we recommend that you set this parameter to aac_low.

    • If you want to play the output audio on general playback devices, we recommend that you set this parameter to aac_he. Compared with aac_low, this profile can achieve the same audio quality at half the bitrate. A common low bitrate is 64 Kbit/s.

    • If you want to play the output audio on high-end playback devices, we recommend that you set this parameter to aac_he_v2. This way, audio files are encoded in smaller sizes and have higher sound quality. Common low bitrates range from 32 Kbit/s to 48 Kbit/s.

    Sampling Rate

    Select a sampling rate from the drop-down list. Unit: Hz. The supported sampling rates vary based on the encoding format or container format. For more information, see Supported sample rates.

    Audio Bitrate

    Valid values: Bitrate of Input Audio and Average Bitrate.

    • Bitrate of Input Audio: The original bitrate of the input audio is used.

    • Average Bitrate: Set an average bitrate for the output audio.

      Note

      The value must be a multiple of 8 within the range of 8 to 160. We recommend that you set this parameter to 64 or 128. Unit: Kbps.

    Bitrate Check

    Required when Audio Bitrate is set to Average Bitrate. Specifies the transcoding method when the bitrate of the input audio is lower than the specified bitrate. Valid values:

    • Transcode Based on Bitrate of Input Audio: The actual bitrate of the original audio is used for transcoding.

    • Transcode Based on Specific Bitrate: The audio is re-encoded based on the specified average bitrate.

    • Do Not Transcode: The original audio is used without transcoding.

    Sound Channels

    Select the number of sound channels. You can select Audio Channels of Input Audio. Default value: 2.

    Volume Normalization

    Automatically adjusts audio volume to ensure consistency across files with different volume levels. Supported only for a single output audio stream. Unavailable when multiple audio streams are configured.

    Note

    Volume Normalization Professional Edition provides more natural and accurate volume control and is billed based on the processing duration. The service is suitable for applications that require higher audio quality. For more information, see Audio and video enhancement fees.

    Container format conversion

    Converts the container format of videos without changing the resolution or bitrate. Supports output formats: MP4, FLV, M3U8 (TS segments), and M3U8 (fMP4 segments).

    Subtitle template

    image

    Parameter

    Description

    Template Name

    The name of the subtitle template.

    External Subtitle File Format

    The format of the external subtitle file. Valid values: srt and ass.

    External Subtitle Encoding Format

    The encoding format of the external subtitle. If set to auto, the detected encoding may not match the actual format. We recommend specifying an explicit encoding format.

    Watermark template

    image

    Parameter

    Description

    Template Name

    The name of the watermark template.

    Watermark Type

    The watermark type. Valid values: Image Watermark and Text Watermark.

    Image watermark configurations

    Watermark Material

    The image to be used as the watermark. Only PNG and GIF images are supported. The image can be up to 20 MB in size.

    Watermark Position

    The watermark position.

    Image Width

    • By Value: the width value of the image watermark. Valid values: 8 to 4096. Unit: pixel.

    • By Percentage: the percentage of the width of the image watermark relative to the video width. The value of this parameter is accurate to two decimal places. Valid values: 0 to 100. Unit: percent (%).

    Image Height

    • By Value: the height value of the image watermark. Valid values: 8 to 4096. Unit: pixel.

    • By Percentage: the percentage of the height of the image watermark relative to the video height. The value of this parameter is accurate to two decimal places. Valid values: 0 to 100. Unit: percent (%).

    Horizontal Offset

    • By Value: the horizontal offset value of the image watermark. Valid values: 8 to 4096. Unit: pixel.

    • By Percentage: the percentage of the horizontal offset of the image watermark relative to the video width. The value of this parameter is accurate to two decimal places. Valid values: 0 to 100. Unit: percent (%).

    Vertical Offset

    • By Value: the vertical offset value of the image watermark. Valid values: 8 to 4096. Unit: pixel.

    • By Percentage: the percentage of the vertical offset of the image watermark relative to the video height. The value of this parameter is accurate to two decimal places. Valid values: 0 to 100. Unit: %.

    Animated Watermark (Timeline)

    When enabled, the watermark appears only during a specified time range.

    Start Time

    The time when the watermark appears. Valid values: 0 to the video duration. Unit: seconds.

    Ending Mode

    Specifies how long the watermark lasts. Valid values:

    • To End: The watermark lasts until the video ends.

    • Duration: The watermark appears for the specified duration. Valid values: 0 to the video duration. Unit: seconds.

    Text watermark configurations

    Text Watermark Content

    The text to be displayed as the watermark.

    Font

    The font.

    Font Size

    The font size. Valid values: 5 to 119. Unit: pixel.

    Font Color

    The font color.

    Font Transparency

    The font transparency. Valid values: 0 to 100. Unit: pixel.

    Horizontal Offset

    • By Value: the horizontal offset value of the text watermark. Valid values: 8 to 4096. Unit: pixel.

    • By Percentage: the percentage of the horizontal offset of the text watermark relative to the video width. The value of this parameter is accurate to two decimal places. Valid values: 0 to 100. Unit: percent (%).

    Vertical Offset

    • By Value: the vertical offset value of the text watermark. Valid values: 8 to 4096. Unit: pixel.

    • By Percentage: the percentage of the vertical offset of the text watermark relative to the video height. The value of this parameter is accurate to two decimal places. Valid values: 0 to 100. Unit: percent (%).

    Outline Width

    The width of the text outline. Valid values: 0 to 4096. Unit: pixel.

    Outline Color

    The color of the text outline.

Call an API operation

To create a custom template, you can call the CreateCustomTemplate operation and configure the Type parameter based on your business requirements.