A camera feed gives you access to a single physical camera attached to your device.
A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. See also CameraServer.
Note: Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background.
Note: This class is currently only implemented on Linux, Android, macOS, and iOS. On other platforms no CameraFeeds will be available. To get a CameraFeed on iOS, enable EditorExportPlatformIOS.modules/camera.
Formats supported by the feed. Each entry is a Dictionary describing format parameters.
Returns the texture backend ID (usable by some external libraries that need a handle to a texture to write data).
Sets the feed format parameters for the given index in the formats array. Returns true on success. By default, the YUYV encoded stream is transformed to FEED_RGB. The YUYV encoded stream output format can be changed by setting parameters's output entry to one of the following:
- "separate" will result in FEED_YCBCR_SEP;
- "grayscale" will result in desaturated FEED_RGB;
- "copy" will result in FEED_YCBCR.
FEED_NOIMAGE = 0No image set for the feed.
FEED_RGB = 1Feed supplies RGB images.
FEED_YCBCR = 2Feed supplies YCbCr images that need to be converted to RGB.
FEED_YCBCR_SEP = 3Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
FEED_EXTERNAL = 4Feed supplies external image.