Unlock Seamless Live Streaming: How to Add Custom Transcoding Configurations for a Flawless Viewing Experience
- The KMS key ID is afce5722-81d2-43c3-9930-7601da11* and the KMS UID is 25346073170691.
- Notes: The template string can only contain numbers, uppercase and lowercase letters, or hyphens (-).
- Notes: When the template type is a video type (e.g., h264, h264-nbhd, h265, or h265-nbhd), the request parameters Height, Width, FPS, and VideoBitrate are required.
Custom Transcoding Template Parameters
Domain and App Strings
The domain string is example.com and the app string is liveApp.
KMS Key ID and UID
The KMS key ID is afce5722-81d2-43c3-9930-7601da11* and the KMS UID is 25346073170691.
KMS Key Expire Interval
The KMS key expire interval is 3600 seconds.
Template String
The template string is LiveCusTranscode.
Notes: The template string can only contain numbers, uppercase and lowercase letters, or hyphens (-). It must start with an uppercase and lowercase letter or a number and cannot be repeated with a standard transcoding template name.
Template Type
The template type is one of the following:
- h264: Customize H264 standard template.
- h264-nbhd: Custom H264 Narrowband HD template.
- h265: Customize H265 standard template.
- h265-nbhd: Customized H265 narrowband HD template.
- audio: Audio-only template.
Notes: When the template type is a video type (e.g., h264, h264-nbhd, h265, or h265-nbhd), the request parameters Height, Width, FPS, and VideoBitrate are required.
Height
The height of the transcoded video is 720 pixels.
Notes: The height must meet the following conditions:
- Height ≥ 100: The height of the video must be at least 100 pixels.
- max(Height, Width) ≤ 2560: The larger of the width and height of the video cannot be greater than 2560.
- min(Height, Width) ≤ 1440: The smaller of the width and height of the video cannot be greater than 1440.
Notes: For 265 narrowband HD templates, the resolution cannot exceed 1280×720.
Width
The width of the transcoded video is 576 pixels.
Notes: The width must meet the following conditions:
- Width ≥ 100: The width of the video must be at least 100 pixels.
- max(Height, Width) ≤ 2560: The larger of the width and height of the video cannot be greater than 2560.
- min(Height, Width) ≤ 1440: The smaller of the width and height of the video cannot be greater than 1440.
Notes: For 265 narrowband HD templates, the resolution cannot exceed 1280×720.
FPS
The frame rate of the transcoded video is 30 FPS.
Notes: The frame rate must be between 1 and 60 FPS.
Video Bitrate
The video bitrate of the transcoded video is 720 kbps.
Notes: The video bitrate must be between 1 and 6000 kbps.
Notes: The actual bitrate of the transcoded video may not be exactly the same as the set bitrate, especially when the set bitrate is too high or too low.
Audio Bitrate
The audio bitrate of the transcoded video is 512 kbps.
Notes: The audio bitrate must be between 1 and 1000 kbps.
GOP
The GOP of the transcoded video is 1.
Notes: The GOP can be set in frames or seconds.
- Frames: The GOP must be between 1 and 3000 frames.
- Seconds: The GOP must be between 1s and 20s.
Profile
The profile of the transcoded video is 2.
Notes: The profile must be one of the following:
- 1: Baseline (suitable for mobile devices).
- 2: Main (suitable for standard resolution devices).
- 3: High (suitable for high-resolution devices).
Audio Profile
The audio profile of the transcoded video is aaclow.
Notes: The audio profile must be one of the following:
- aaclow
- aache
- aachev2
- aacld
Audio Codec
The audio codec of the transcoded video is AAC.
Audio Rate
The audio rate of the transcoded video is 96000 Hz.
Notes: The audio rate must be between 22050 and 96000 Hz.
Notes: If the audio profile is aac_ld, the audio rate cannot exceed 44100 Hz.
Audio Channel Num
The audio channel number of the transcoded video is 2.
Notes: The audio channel number must be one of the following:
- 1: Mono.
- 2: Dual channel.
Laziness
The laziness of the transcoded video is yes.
Notes: The laziness must be one of the following:
- yes: Enable trigger transcoding.
- no: Do not enable triggering transcoding.
Encrypt Parameters
The encrypt parameters of the transcoded video are:
{
"EncryptType": "aliyun",
"KmsKeyID": "afce5722-81d2-43c3-9930-7601da11*",
"KmsKeyExpireInterval": "3600"
}
Notes: If the encrypt parameters are configured, the KmsKeyID, KmsUID, and KmsKeyExpireInterval parameters cannot be empty.
Resolution with Source
The resolution with source of the transcoded video is:
{
"Type": "short",
"Value": "1080"
}
Notes: The resolution with source must include the following fields:
- Type: Only short (short side adaptive), long (long side adaptive), and screen (horizontal and vertical screen adaptive) can be passed.
- Value: The possible values are 240, 360, 480, 540, 720, 1080, and 2160.
Frame Rate with Source
The frame rate with source of the transcoded video is:
{
"UpLimit": 60,
"LowerLimit": 1
}
Notes: The frame rate with source must include the following fields:
- UpLimit: The upper frame rate limit, enter an integer in the range of 1-60 and it must be greater than the lower frame rate limit.
- LowerLimit: The frame rate lower limit, enter an integer in the range of 1-60 and it must be less than the frame rate upper limit.
Bitrate with Source
The bitrate with source of the transcoded video is:
{
"UpLimit": 2500,
"LowerLimit": 800,
"Factor": 1
}
Notes: The bitrate with source must include the following fields:
- UpLimit: The upper bitrate limit, enter an integer in the range of 128-10000 and it must be greater than the lower bitrate limit.
- LowerLimit: The bitrate lower limit, enter an integer in the range of 128-10000 and less than the bitrate upper limit.
- Factor: The output ratio according to source bitrate, input range 0.1-1, accurate to one decimal place, “1” means output according to source stream.
Other Source Configurations
The other source configurations of the transcoded video are:
{
"KeyFrameOpen": "yes",
"Copyts": "yes",
"SeiMode": 1
}
Notes: The other source configurations must include the following fields:
- KeyFrameOpen: yes or no.
- Copyts: yes or no.
- SeiMode: The possible values are 0 (not transparent), 1 (transparent but not all), and 2 (transparent and all).
