CameraCapturerConfiguration

Camera capture configuration.

export class CameraCapturerConfiguration {
  
  cameraDirection?: CameraDirection;

  cameraFocalLengthType?: CameraFocalLengthType;
  
  deviceId?: string;

  cameraId?: string;
  
  format?: VideoFormat;

  followEncodeDimensionRatio?: boolean;

}

Properties

cameraDirection
(Optional) Camera direction. See CameraDirection.
cameraId
(Optional) Camera ID. Defaults to the ID of the front-facing camera. You can obtain the camera ID using the Android native system API. See Camera.open()) and CameraManager.getCameraIdList().
Note:
  • This parameter is for Android only.
  • Both this parameter and cameraDirection are used to specify the camera and are mutually exclusive. You can choose either based on your needs. The differences are as follows:
  • Using cameraDirection is simpler. You only need to specify the camera direction (front or rear), without specifying the exact camera ID. The SDK will use system APIs to retrieve and determine the actual camera ID.
  • Using cameraId allows you to specify a particular camera more precisely. On devices with multiple cameras, cameraDirection may not be able to identify or access all available cameras. In such cases, it is recommended to use cameraId to directly specify the desired camera ID.
cameraFocalLengthType
(Optional) Camera focal length type. See CameraFocalLengthType.
Note:
  • To set the camera focal length type, only cameraDirection is supported. cameraId is not supported.
  • Some iOS devices have rear cameras composed of multiple lenses, such as dual (wide and ultra-wide) or triple (wide, ultra-wide, and telephoto) cameras. For such composite lenses with ultra-wide capability, you can achieve ultra-wide capture in either of the following ways:
  • Option 1: Set this parameter to CameraFocalLengthUltraWide (2) (ultra-wide lens).
  • Option 2: Set this parameter to CameraFocalLengthDefault (0) (standard lens), then call setCameraZoomFactor to set the camera zoom factor to a value less than 1.0, with a minimum of 0.5.
The difference is that Option 1 provides a fixed ultra-wide angle, while Option 2 allows flexible adjustment of the zoom factor.
format
(Optional) Video frame format. See VideoFormat.
followEncodeDimensionRatio
(Optional) Whether to follow the video aspect ratio set in setVideoEncoderConfiguration:
  • true: (Default) Follow. The SDK crops the captured video to match the configured aspect ratio, and synchronously updates the local preview, onCaptureVideoFrame, and onPreEncodeVideoFrame.
  • false: Do not follow. The SDK does not change the aspect ratio of the captured video frame.