Skip to main content
Version: next

cameraId

info

Added in Scrcpy 2.2

  • Type: string | undefined
  • Default value: undefined

Specifies the camera ID to use when videoSource is set to "camera".

When not specified, Scrcpy will use the default camera based on other camera settings like cameraFacing. This option allows specifying a particular camera by its unique identifier if you need to select a specific camera on devices with multiple cameras.

  • videoSource: Must be set to "camera" for this option to take effect
  • cameraFacing: Alternative way to select camera based on facing direction
  • cameraSize: Sets the camera capture size

Example

import { ScrcpyOptions2_2 } from "@yume-chan/scrcpy";

const options = new ScrcpyOptions2_2({
videoSource: "camera", // Enable camera source
cameraId: "0", // Use camera with ID "0"
});