Functions

MPC transcodes audio and video files stored in OBS buckets to formats that can be played on a broad range of devices. It also provides functions such as frame capture, encryption, and watermarking.

Media Transcoding

Media transcoding is to convert an audio or video file into one or more output formats. This involves changing the parameters of the media file such as the format, codec, bitrate, and frame rate.

Parameter

Description

Input format

  • Input file formats: MP4, TS, MOV, FLV, MPG, MXF, WMV, ADTS, AVI, MKV, MPEG, GIF, and WAV
  • Video codecs: H.264, H.265, MPEG-2, MPEG-4, MJPEG, WMV1/2/3, and Proress422
  • Audio codecs: AAC, AC3, EAC3, HE-AAC, MP2, MP3, PCM (s161e, s16be, s241e, s24be, DVD), and WMA
  • Subtitle format: SRT file in UTF-8

Output format

  • Output file formats: DASH, HLS, MP4, MP3, and ADTS
  • Video codecs: H.264 and H.265
  • Audio codecs: HE_AAC, AAC, and MP3
  • Image file format: GIF

Audio extraction

Extract audio from a video.

Mute video

Remove sound from a video.

Subtitling

Add subtitles to a video.

Watermarking

During transcoding, add digital watermarks to videos for copyright protection.

The transcoded audio and video specifications can be customized based on your needs. For details, see Table 1, Table 2, Table 3, and Table 4.

Table 1 Video encoding parameters

Parameter

Description

Video Codec

The value can be H.264 or H.265. The default value is H.264.

Resolution (video width and video height)

  • H.264
    • Video width: [32, 4,096] or 0. The unit is px.
    • Video height: [32, 2,880] or 0. The unit is px.
  • H.265
    • Video width: [160, 4,096] or 0. The unit is px.
    • Video height: [96, 2,880] or 0. The unit is px.

If the video width and height are both set to 0, the transcoded video is produced based on the original resolution. If the video bandwidth or height is set to 0, the corresponding value is adjusted based on the original size.

Bitrate

Video bitrate. The value can be 0 or ranges from 40 to 30,000. The unit is kbit/s.

If this parameter is set to 0, an output file is generated at the adaptive bitrate.

Maximum I-Frame Interval

Maximum interval between I frames in a key frame. The value ranges from 2 to 5.

Maximum Consecutive B-Frames

Maximum number of consecutive B-frames in a key frame. The value ranges from 0 to 7.

Profile

Encoding profile.

  • If the video codec is H.264, BASE, MAIN, and HIGH are available.
  • If the video codec is H.265, only MAIN is available.

FPS

Video frame rate. The value is 0 or ranges from 5 to 30.

If this parameter is set to 0, an output file is generated at the original bitrate.

Maximum Reference Frames

Maximum number of reference frames.

  • If the video codec is H.264, the value ranges from 1 to 8.
  • If the video codec is H.265, the value is always 4.

Quality

Video encoding level. There are three levels. A larger value indicates higher encoding quality and longer transcoding time.

Black Bar Removal

Automatically detect and remove black bars from your video.

Table 2 Video processing parameters

Parameter

Description

Video rotation angle

Rotate a video clockwise. Videos can be simply rotated by 90 degrees, 180 degrees, and 270 degrees.

Adaptive resolution

The following options are available:

  • SHORT: Adaptive width
  • LONG: Adaptive height
  • None: Do not adapt.
Table 3 Audio encoding parameters

Parameter

Description

Audio Codec

The available options are AAC, HE_AAC1, HE_AAC2, and MP3. The default value is AAC.

Sampling Rate

The value can be AUTO, 22050 Hz, 32000 Hz, 44100 Hz, 48000 Hz, or 96000 Hz. The default value is AUTO.

Bitrate

Audio bitrate. The value can be 0 or ranges from 8 to 1,000. The unit is kbit/s.

Audio Channel

Number of audio channels. The value can be 1 or 2.

Table 4 Video processing parameters

Parameter

Description

Volume control

Two methods are supported:

  • auto: Adjust the volume automatically.
  • dynamic: Adjust the volume manually.

Volume adjustment amplitude

The value range is [-15, 15], and the unit is dB.

Transcoding Templates

MPC provides plenty of built-in transcoding templates to meet your diverse requirements. You can also create a transcoding template to target your specific scenario.

  • Preset templates: You can directly use these templates without any other configuration. There are audio templates, audiovisual templates, and low bitrate HD templates, covering all output formats, encoding formats, and common resolutions and bitrates. Based on the number of output files, preset templates are classified into the following types:
    • One-in and one-out transcoding template: Only one output file is generated.
    • One-in multiple-out transcoding template: A maximum of nine output files can be generated.
  • Custom templates: Set the video and audio parameters based on your needs. A custom template can be a one-in and one-out transcoding template or one-in and multiple-out transcoding template. A maximum of six output specifications can be configured for a one-in multiple-out template.

Low Bitrate HD

MPC uses perceptual coding to analyze each scenario, action, content, and texture in a video, achieving lower bitrate and bandwidth usage at a given video quality.

Packaging

Packaging is to convert the container format of a video without changing its resolution and bitrate.

  • Supported input formats: MP4, FLV, and TS
  • Supported output formats: HLS and MP4

Animated GIFs

Capture a slice of a video and convert it to a GIF file.

Table 5 describes the custom parameters for converting a GIF file.

Table 5 Parameters

Parameter

Description

Format

Output file format. The GIF format is supported.

Width

Width of an output file. The value can be 0, -1, or within the range from 32 to 3,840.

If this parameter is set to -1, the width is auto-filled based on the height. If this parameter is set to 0, a GIF file is generated based on the original width.

Height

Height of an output file. The value can be 0, -1, or within the range from 32 to 3,840.

If this parameter is set to -1, the height is auto-filled based on the width. If this parameter is set to 0, a GIF file is generated based on the original width.

FPS

Frame rate of an output file. The value range is [1, 75].

Video Watermark

  • You can add both image and text watermarks to videos.
  • The input format can be PNG, JPG, or JPEG.
  • A maximum of two static images can be overlaid on an output video per frame.
  • A maximum of 10 static images can be overlaid on each output video.
  • The resolution of a watermark cannot be lower than 8x8 and greater than 4,096x4,096. The size of the watermark cannot exceed 10 MB.

Frame Capture

Capture a frame from a video and save it as a JPG file. You can take a snapshot during transcoding or at any other time. The following two capture methods are supported:

  • By interval: Take snapshots at regular intervals. The default interval is 12s.
  • At fixed time: Take snapshots at specified time points.

Video Encryption

Video encryption refers to encrypting HLS video content using the HLS AES-128 protocol. You can use the player provided by HUAWEI CLOUD to decrypt and play the video.
  • Security and compatibility with different devices
  • Encrypt video content during transcoding or not.