Interface CustomVideoTrackInitConfig

Configurations for the custom video track. Set these configurations when calling [AgoraRTC.createCustomVideoTrack]IAgoraRTC.createCustomVideoTrack.

interface CustomVideoTrackInitConfig {
    bitrateMax?: number;
    bitrateMin?: number;
    frameRate?: number | ConstrainLong;
    height?: number | ConstrainLong;
    mediaStreamTrack: MediaStreamTrack;
    optimizationMode?: "motion" | "detail";
    width?: number | ConstrainLong;
}

Properties

bitrateMax?: number

The maximum bitrate of sending the video track (Kbps).

bitrateMin?: number

The minimum bitrate of sending the video track (Kbps).

frameRate?: number | ConstrainLong

Since


   4.17.1

Frame rate of the video (fps).

You can pass a number, or a constraint such as { max: 30, min: 5 }.

For details about the constraint, see [ConstrainLong]ConstrainLong.

height?: number | ConstrainLong

Since


   4.17.1

Height of the video.

You can pass a number, or a constraint such as { max: 1280, min: 720 }.

For more details about the constraint, see [ConstrainLong]ConstrainLong.

mediaStreamTrack: MediaStreamTrack

Your MediaStreamTrack object.

optimizationMode?: "motion" | "detail"

Since


   4.2.0

Sets the video transmission optimization mode.

You can call this method during a video call, a live streaming or screen sharing to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from text to video, you can change the optimization mode from "detail" to "motion" to ensure smoothness in poor network conditions.

Note: This method supports Chrome only.

Param: mode

The video transmission optimization mode:

  • "balanced": Uses the default optimization mode.
    • For a screen-sharing video track, the default transmission optimization strategy is to prioritizes clarity.
    • For the other types of video tracks, the SDK may reduce the frame rate or the sending resolution in poor network conditions.
  • "detail": Prioritizes video quality.
    • The SDK ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
    • In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
  • "motion": Since 4.21.0, the SDK prioritizes video smoothness.
  • In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
  • In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
width?: number | ConstrainLong

Since


   4.17.1

Width of the video.

You can pass a number, or a constraint such as { max: 1280, min: 720 }.

For more details about the constraint, see [ConstrainLong]ConstrainLong.