Updated on 2025-07-22 GMT+08:00

Custom Templates

In addition to the presets, you can customize one-in one-out transcoding templates based on your needs.

Creating a Transcoding Template

You can specify transcoding parameters as needed.

  1. Log in to the MPC console.
  2. In the navigation pane, choose Global Settings > Custom Templates.
  3. Click Custom Templates. On the displayed page, specify related parameters.

    Figure 1 Custom templates

  4. Set basic information. See Table 1.

    Table 1 Basic information

    Parameter

    Description

    Template Name

    Enter a maximum of 128 characters. Only letters, underscores (_), and digits are allowed.

    Example: MP4_H264

    Output Format

    Format of an output audio or video file.

    The following output formats are supported:

    • Video formats: MP4, HLS, DASH+HLS, and DASH
    • Audio formats: ADTS and MP3

    Note: If you select Audio only, the video parameters are disabled and only audio is transcoded.

  5. Configure video parameters by referring to Table 2.

    If Audio only is selected, the output file does not contain any video information. This option applies to the scenario where audio is extracted from a media file. Perform step 7 to set audio parameters.

    Table 2 Basic video parameters

    Parameter

    Description

    Video Codec

    The H.264 and H.265 formats are supported.

    Low Bitrate HD (PVC)

    Whether to enable low bitrate HD. The function is disabled by default.

    If this function is enabled, the output bitrate is about 20% lower than the configured bitrate.

    HLS Segment Duration

    Duration of an HLS segment. This parameter is only used when Output Format is set to HLS or DASH+HLS.

    The value ranges from 2 to 10.

    Default value: 5

    Unit: second

    Dash Segment Duration

    Length of a dash segment. This parameter is only used when Output Format is set to DASH or DASH+HLS.

    The value ranges from 2 to 10.

    Default value: 5

    Unit: second

    Width (Unit: px)

    Width of an output video.

    Its value range:
    • If H.264 is selected for Video Codec, this value is 0 or a multiple of 2 from 32 to 4,096.
    • If H.265 is selected for Video Codec, this value is 0 or a multiple of 2 from 160 to 4,096.

    Height (Unit: px)

    Height of an output video.

    Its value range:
    • If H.264 is selected for Video Codec, this value is 0 or a multiple of 2 from 32 to 2,880.
    • If H.265 is selected for Video Codec, this value is 0 or a multiple of 2 from 96 to 2,880.

    Bitrate (Unit: kbit/s)

    Bitrate of an output video.

    The value is 0 or ranges from 40 to 30,000, in kbit/s.

    You are advised to set it to a recommended value. For details, see Table 3. If Bitrate is set to 0, the recommended bitrate is used.

    • If both the width and height of the transcoded video are set to 0, the transcoded video is output based on the source video resolution.
    • If only one side (width or height) of the transcoded video is set to 0, the value of the other side is used to perform proportional scaling based on the source video resolution and output the transcoded video.
    Table 3 Recommended resolutions and bitrates

    Video Quality

    Recommended Resolution

    Recommended Bitrate for H.265 (kbit/s)

    Recommended Bitrate for H.264 (kbit/s)

    4K

    3840 x 2160

    5600

    8000

    2K

    2560 x 1440

    4900

    7000

    UHD

    1920 x 1080

    2100

    3000

    HD

    1280 x 720

    700

    1000

    SD

    854 x 480

    500

    600

    LD

    480 x 270

    200

    300

    If the bitrate is set to 0 and the configured resolution is not one of the recommended resolutions in the preceding table, use the recommended bitrate for the recommended resolution which is close to the configured resolution.

    For example, if the bitrate is set to 0 and the resolution is set to 900 x 500, the output bitrate is the recommended bitrate for the resolution 854 x 480, that is, 500 for H.265 and 600 for H.264.

  6. Configure advanced video parameters by referring to Table 4.

    Table 4 Advanced video parameters

    Parameter

    Description

    Maximum I-Frame Interval

    Maximum interval between I frames (initial frame during playback).

    The value ranges from 2 to 5.

    Maximum Consecutive B-Frames

    Maximum number of consecutive B-frames (intermediate frames during playback).

    Value range:
    • 0 to 7 for H.264. The default value is 4.
    • 0 to 7 for H.265. The default value is 7.

    Profile

    Video encoding level, which is related to the video codec. It cannot be modified.

    • If Video Codec is H.264, the default value is VIDEO_PROFILE_H264_HIGH.
    • If Video Codec is H.265, the default value is VIDEO_PROFILE_H265_MAIN.

    FPS

    Frame rate of an output video file.

    The value is 0 or ranges from 5 to 30.

    The value 0 indicates that the FPS of the output video is the same as that of the input video.

    Maximum Reference Frames

    Number of past and future frames affected during decoding.

    Its value is:
    • An integer ranging from 1 to 8 for H.264
    • Permanently 4 for H.265

    Quality

    Quality level of video encoding. It cannot be modified.

    Possible values are:
    • VIDEO_PRESET_HSPEED2
    • VIDEO_PRESET_HSPEED
    • VIDEO_PRESET_NORMAL (default value)

    Black Bar Removal

    Whether to automatically detect black bars and remove them.

    This function is disabled by default.

  7. Configure audio parameters by referring to Table 5.

    If Video only is selected, the output file does not contain any audio information. This option applies to the scenario where video is extracted from a media file.
    Table 5 Audio parameters

    Parameter

    Description

    Audio Codec

    Audio codec.

    Possible values include AAC and HEAAC1. The default value is AAC.

    Audio Channel

    Possible values include Stereo, Mono, and 5.1 Channel. The default is Stereo.

    Sampling Rate

    Choose one from Auto, 22050, 32000, 44100, 48000, and 96000. The default value is Auto. The unit is Hz.

    Auto indicates adaptive sampling.

    Bitrate

    Bitrate of an output audio.

    The value is 0 or an integer ranging from 8 to 1,000.

    Unit: kbit/s

  8. Click OK.

Modifying a Transcoding Template

You can modify a custom template, including the video parameters, audio parameters, and template name, to meet your service requirements.

  1. Log in to the MPC console.
  2. In the navigation pane, choose Global Settings > Custom Templates.
  3. Locate the target template and click Modify in the Operation column.
  4. Reconfigure the parameters that you want to modify. For details about the parameters, see Creating a Transcoding Template.
  5. Click OK.

Deleting a Transcoding Template

You can delete a template that is no longer used.

  1. Log in to the MPC console.
  2. In the navigation pane, choose Global Settings > Custom Templates.
  3. Locate the target template and click Delete in the Operation column.
  4. Click Yes.