Skip to main content

Camera Component

UEstuaryCameraComponent

USceneComponent — captures an image (rendered scene or webcam), encodes it as JPEG, and sends it to the server for vision analysis. Add it to your character actor. See Vision for the full workflow.

:::caution Consent required No frame is sent — including server-initiated captures — unless consent has been granted via SetCameraConsent(true). :::

Methods

FunctionReturnsDescription
SetCameraConsent(bool bGranted)voidGrant or revoke capture consent. Required before any send.
SendCameraFrame()boolCapture and send the current rendered-scene frame.
SetRenderTargetSize(int32 Width, int32 Height)boolSet the scene-capture resolution.
SetCaptureSource(EEstuaryCaptureSource NewSource)voidSwitch between RenderedScene and Webcam.
IsWebcamMode() constboolTrue when the source is webcam.
StartWebcam(int32 DeviceIndex = 0)boolOpen a webcam device.
StopWebcam()voidClose the webcam.
SendWebcamFrame()boolCapture and send the current webcam frame.
GetCharacterId() constFStringOwning character's ID.

Properties

PropertyTypeDefaultDescription
Capture SourceEEstuaryCaptureSourceRenderedSceneActive capture source.
JPEG Qualityint3275Compression quality (1–100).
Has User ConsentboolfalseRead-only; set via SetCameraConsent.
Webcam Blit MaterialUMaterialInterface*Material used to blit webcam frames (webcam mode).

Example

CameraComponent->SetCameraConsent(true);
CameraComponent->SetRenderTargetSize(1280, 720);
CameraComponent->SendCameraFrame();

// Webcam
CameraComponent->SetCaptureSource(EEstuaryCaptureSource::Webcam);
CameraComponent->StartWebcam(0);
CameraComponent->SendWebcamFrame();

Bind UEstuaryCharacterComponent::OnVisionResponse to receive the streamed description, and OnCameraCaptureRequested to handle server-initiated captures. See Vision.