Help Center/ Media Processing Center/ User Guide/ Customizing a Transcoding Template Group
Updated on 2022-03-17 GMT+08:00

Customizing a Transcoding Template Group

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

Creating a Transcoding Template Group

You can specify transcoding parameters as needed.

  1. Log in to the MPC console.
  2. In the navigation pane, choose Global Settings > Custom Template Groups.
  3. Click Create Custom Template Group. In the displayed dialog box, specify related parameters.

  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. Set video parameters. See 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

    Length 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: s

    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: s

    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.

    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 video width and height are set to 0, an output video is generated based on the resolution of the input video.
    • If the video bandwidth or height is set to 0, the corresponding value is scaled based on the original size.
    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

    3840x2160

    5600

    8000

    2K

    2560x1440

    4900

    7000

    UHD

    1920x1080

    2100

    3000

    HD

    1280x720

    700

    1000

    SD

    854x480

    500

    600

    LD

    480x270

    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 900x500, the output bitrate is the recommended bitrate for the resolution 854x480, that is, 500 for H.265 and 600 for H.264.

  6. Click Add to add resolutions and bitrates.
  7. Configure advanced video parameters. See 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.

  8. Set 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

  9. Click OK.

Modifying a Transcoding Template Group

You can modify a custom template group, 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 Template Groups.
  3. Locate the target template group 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 Group.
  5. Click OK.

Deleting a Transcoding Template Group

You can delete a template group that is no longer used.

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