LiveTranscoding
Transcoding properties for CDN streaming.
export class LiveTranscoding {
width?: number;
height?: number;
videoBitrate?: number;
videoFramerate?: number;
lowLatency?: boolean;
videoGop?: number;
videoCodecProfile?: VideoCodecProfileType;
backgroundColor?: number;
videoCodecType?: VideoCodecTypeForStream;
userCount?: number;
transcodingUsers?: TranscodingUser[];
transcodingExtraInfo?: string;
metadata?: string;
watermark?: RtcImage[];
watermarkCount?: number;
backgroundImage?: RtcImage[];
backgroundImageCount?: number;
audioSampleRate?: AudioSampleRateType;
audioBitrate?: number;
audioChannels?: number;
audioCodecProfile?: AudioCodecProfileType;
advancedFeatures?: LiveStreamAdvancedFeature[];
advancedFeatureCount?: number;
}
Properties
- width
- Total width of the video stream in pixels, default is 360.
- For video streams, the value range is [64,1920]. Values below 64 will be adjusted to 64, and values above 1920 will be adjusted to 1920 by the Agora server.
- For audio-only streams, set both
widthandheightto 0.
- height
- Total height of the video stream in pixels, default is 640.
- For video streams, the value range is [64,1080]. Values below 64 will be adjusted to 64, and values above 1080 will be adjusted to 1080 by the Agora server.
- For audio-only streams, set both
widthandheightto 0.
- videoBitrate
- Video encoding bitrate in Kbps. You do not need to set this parameter. Keep the default value
STANDARD_BITRATE, and the SDK will automatically match the optimal bitrate based on the video resolution and frame rate you set. For the relationship between resolution and frame rate, see Video Profile. - videoFramerate
- Frame rate of the output video for CDN streaming. The range is (0,30], in fps. Default is 15 fps.
Note: The Agora server will adjust any value above 30 fps to 30 fps.
- lowLatency
-
Note: Deprecated, not recommended.Low latency mode
- true: Low latency, no guarantee on video quality.
- false: (default) High latency, guaranteed video quality.
- videoGop
- GOP (Group of Pictures) of the output video for CDN streaming, in frames. Default is 30.
- videoCodecProfile
- Codec profile of the output video for CDN streaming. Can be set to 66, 77, or 100. See VideoCodecProfileType.
Note: If you set this parameter to other values, the Agora server will adjust it to the default value.
- videoCodecType
- Codec type of the output video for CDN streaming. See VideoCodecTypeForStream.
- transcodingUsers
- Manages users participating in video mixing for CDN streaming. Supports up to 17 users simultaneously. See TranscodingUser.
- transcodingExtraInfo
- Reserved parameter: custom information sent to the CDN client, used to fill SEI frames in H264/H265 video. Length limit: 4096 bytes.
- backgroundColor
- Background color of the output video for CDN streaming, specified as a hexadecimal RGB integer without the # symbol, e.g., 0xFFB6C1 for light pink. Default is 0x000000 (black).
- userCount
- Number of users in the video mixing layout. Default is 0. Value range: [0,17].
- metadata
- Metadata sent to the CDN client.
Note: Deprecated, not recommended.
- watermark
- Watermark on the live video. The image format must be PNG. See RtcImage.
You can add one watermark or use an array to add multiple watermarks. This parameter works with
watermarkCount. - backgroundImage
- Background image on the live video. The image format must be PNG. See RtcImage.
You can add one background image or use an array to add multiple background images. This parameter works with
backgroundImageCount. - audioSampleRate
- Audio sample rate (Hz) of the output media stream for CDN streaming. See AudioSampleRateType.
- audioBitrate
- Bitrate of the output audio for CDN streaming, in Kbps. Default is 48, maximum is 128.
- audioChannels
- Number of audio channels in the output audio for CDN streaming. Default is 1. Value range: integer from [1,5]. Recommended values are 1 or 2. Values 3, 4, and 5 require special player support:
- 1: (default) Mono
- 2: Stereo
- 3: Three channels
- 4: Four channels
- 5: Five channels
- audioCodecProfile
- Codec profile of the output audio for CDN streaming. See AudioCodecProfileType.
- watermarkCount
- Number of watermarks on the live video. The total number of watermarks and background images must be between 0 and 10. This parameter works with
watermark. - backgroundImageCount
- Number of background images on the live video. The total number of watermarks and background images must be between 0 and 10. This parameter works with
backgroundImage. - advancedFeatures
- Advanced features for live transcoding. See LiveStreamAdvancedFeature.
- advancedFeatureCount
- Number of enabled advanced features. Default is 0.