Interface CameraVideoTrackInitConfig

Configurations for the video track from the video captured by a camera. Set these configurations when calling [AgoraRTC.createCameraVideoTrack]createCameraVideoTrack.

Hierarchy

  • CameraVideoTrackInitConfig

Properties

cameraId?: string

Specifies the camera ID.

You can get a list of the available cameras by calling [AgoraRTC.getCameras]getCameras.

encoderConfig?: string | VideoEncoderConfiguration

The video encoder configurations.

You can set the video encoder configurations in either of the following ways:

  • Pass the preset video encoder configurations by using [[VideoEncoderConfigurationPreset]].
  • Pass your customized video encoder configurations by using [[VideoEncoderConfiguration]].
  • Leave this property empty to use the SDK's default value, "480p_1" (resolution: 640 × 480, frame rate: 15 fps, bitrate: 500 Kbps).
facingMode?: VideoFacingModeEnum

Whether to user the front camera or the rear camera.

You can use this parameter to choose between the front camera and the rear camera on a mobile device:

  • "user": The front camera.
  • "environment": The rear camera.
optimizationMode?: "motion" | "detail"

Since
   4.0.0

Transmission optimization mode. Whether to prioritize video quality or smoothness:

  • "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": 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.
  • Empty: Uses the default transmission optimization mode. The SDK may reduce the frame rate or the sending resolution in poor network conditions.

Note: This method is only supported on Chrome.