This topic describes some recommended template configurations for media processing.
Transcoding templates
Video parameters
Disable Video
If you select this check box, the transcoded stream does not contain video information. You can select this check box to extract audio in scenarios such as radio broadcast.
Bitrate and Resolution
Bitrate refers to the data traffic that video files use per unit of time. It is the most important item for image quality control in video encoding. The bitrate is measured in bits per second (bit/s), and is often used in the units of Kbit/s and Mbit/s.
For videos that have the same resolution, a higher bitrate indicates a smaller compression ratio and higher video quality. A higher bitrate indicates a higher sampling rate per unit of time and a higher data stream accuracy. Therefore, the quality and definition of the processed video file are close to those of the original file. The processed file requires excellent decoding capabilities from the playback device.
Resolution refers to the capability to distinguish details of a video. It is the number of pixels in each direction. For example, 1,280 × 720 refers to a width of 1,280 pixels and a height of 720 pixels.
The resolution determines how realistic and clear the video appears. A video that has a higher resolution contains more pixels and has clearer images. The resolution is a key factor that determines the bitrate. Videos that have different resolutions use different bitrates.
In general, higher resolutions require higher bitrates. Each resolution corresponds to a recommended range of bitrates. If the bitrate is below the lower limit of this range, the video quality is poor. However, if the bitrate is higher than the upper limit of this range, the network traffic and storage space are wasted, and the improvement to image quality is limited.
The following table lists the recommended bitrate and resolution for each definition.
Definition
Recommended bitrate
Recommended resolution
Resolution range
Low Definition
400
640×360
128×128~640×360
Standard Definition
900
720×540
640×360~720×540
High Definition
1500
1280×720
720×540~1280×720
Ultra High Definition
3000
1920×1080
1280×720~1920×1080
2K
3500
2560×1440
1920×1080~2560×1440
4K
6000
2560×1440
2560×1440~3840×2160
NoteThe width and height of the resolution are optional. If only the width is set, the height is automatically set based on the aspect ratio of the video mezzanine file. If neither the width nor the height is set, the width and height of the video mezzanine file are used.
The unit of the bitrate is Kbit/s.
The unit of the resolution (width × height) is pixel.
Frame Rate
The frame rate is used to measure the number of frames that are displayed per unit of time in a video, or the number of frames that are refreshed per second in an image. The unit of frame rate is frame per second (FPS) or Hz.
A higher frame rate makes a video smoother and more lifelike. In most cases, 25 to 30 fps is sufficient. 60 fps can deliver an immersive and realistic playback experience. If you increase the frame rate to more than 75 fps, the improvement of playback experience is less significant. If you specify a frame rate higher than the refresh rate of your monitor, the monitor cannot properly display the frames and the processing potential of your graphics card is wasted. Higher frame rates at the same resolution require greater processing capabilities from the graphics card.
n ApsaraVideo VOD, the recommended frame rate is 25 fps.
Maximum Keyframe Interval (the number of frames in a GOP)
A Group of Pictures (GOP) is a group of continuous images in an MPEG-encoded video or video stream. A GOP starts with an I-frame and ends with the next I-frame. A GOP contains the following image types:
Intra coded picture (I-frame): the keyframe. An I-frame contains all information that is required to produce the picture for that frame. The I-frame is independently decoded and can be regarded as a static picture. The first frame in the video sequence is always an I-frame, and each GOP starts with an I-frame.
P-frame (predictive coded picture): A P-frame must be encoded with reference to the preceding I-frame. A P-frame contains motion-compensated difference information relative to the previous I-frame or P-frame. During decoding, the difference defined by the current P-frame is superimposed with the previously cached image to generate the final image. P-frames occupy fewer data bits compared with I-frames. However, P-frames are sensitive to transmission errors due to the complex dependencies on the previous I-frame or P-frame.
Bidirectionally predictive coded picture (B-frame): A B-frame contains motion-compensated difference information relative to the previous and subsequent frames. During decoding, the data of the current B-frame is superimposed with the previously cached image and the decoded subsequent image to generate the final image. B-frames provide a high compression ratio and require high decoding performance.
The GOP value indicates the interval of keyframes, the distance between two Instantaneous Decoding Refresh (IDR) frames, or the maximum number of frames in a frame group. At least one keyframe is required for each second of video. The addition of more keyframes improves video quality, but results in increased bandwidth consumption and higher network load. The GOP value (number of frames) divided by the frame rate is the interval.
In ApsaraVideo VOD, the recommended GOP value is 250 frames and the recommended frame rate is 25 fps. Therefore, the recommended interval is 10 seconds.
Audio parameters:
Disable Audio
If you select this check box, the transcoded stream does not contain audio information. You can select this check box if you want to disable the audio in the video mezzanine file.
Sample Rate
The sampling rate, or sampling frequency, defines the number of samples that are extracted from continuous-time signals every second to form discrete-time signals. Unit: Hz. The sample rate refers to the number of samples per unit of time for an analog signal converted into a digital signal. A higher sample rate provides a more real and natural sound.
In ApsaraVideo VOD, the recommended sample rate is 44,100 Hz.
Bitrate
Sound quality
Recommended bitrate
Standard sound quality
128
High sound quality
320
NoteThe unit of the bitrate is Kbit/s. The audio bitrate can range from 8 to 1,000 Kbits/s.
Audio Channels
In ApsaraVideo VOD, the recommended number of audio channels is 2.
Snapshot template configuration
Normal snapshots
Set parameters for normal snapshots based on your business requirements. For more information, see Parameters for normal snapshots (SnapshotConfig). If the width and height of snapshots must be the same as those of the video mezzanine file, we recommend that you do not set the Width and Height parameters.
Sprite snapshots
Set parameters for sprite snapshots based on your business requirements. For more information, see Parameters for sprite snapshots (SpriteSnapshotConfig). If you do not have special requirements for the KeepCellPic parameter, we recommend that you set its value to delete so that the original small image files used to generate the sprite snapshots are deleted.
Watermark configuration
Image watermark
To ensure the display quality of image watermarks at different video resolutions, we recommend that you set the Width, Height, Dx, and Dy parameters based on image proportions. For more information, see Parameters for image watermarks.
Text watermark
For more information about the parameters of text watermarks, see Parameters for text watermarks. Unless otherwise required, we recommend that you set parameters other than Content to the default values.