Stream camera video, capture frames or photos, and configure resolution and frame rate.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "camera-streaming" skill from askskill: 1. Download https://raw.githubusercontent.com/facebook/meta-wearables-dat-ios/main/plugins/mwdat-ios/skills/camera-streaming/SKILL.md 2. Save it as ~/.claude/skills/camera-streaming/SKILL.md 3. Reload skills and tell me it's ready
Use camera-streaming to connect to the default camera and capture one photo as a JPEG. Return the file path and capture timestamp.
Returns the saved photo location, timestamp, and capture success status.
Use camera-streaming to start a camera video stream at 1280x720 and 30 fps, and keep outputting frames for downstream processing.
Returns active stream details including resolution, frame rate, and frame availability status.
Use camera-streaming to switch the camera to 640x480 at 15 fps, capture the next 10 frames for testing, and list each frame number and timestamp.
Returns the configured capture results, including settings and basic information for 10 frames.
Guide for implementing camera streaming and photo capture with the DAT SDK.
.makeUIImage() to renderimport MWDATCamera
import MWDATCore
let wearables = Wearables.shared
let deviceSelector = AutoDeviceSelector(wearables: wearables)
// Or for a specific device: SpecificDeviceSelector(device: deviceId)
let deviceSession = try wearables.createSession(deviceSelector: deviceSelector)
try deviceSession.start()
// Wait for the device session to reach the started state
for await state in deviceSession.stateStream() {
if state == .started { break }
}
Once the DeviceSession is started, add a Stream capability:
let config = StreamConfiguration(
videoCodec: .raw,
resolution: .medium, // 504x896
frameRate: 24
)
guard let stream = try deviceSession.addStream(config: config) else {
// DeviceSession must be in the started state before adding a stream
return
}
| Resolution | Size |
|---|---|
.high | 720 x 1280 |
.medium | 504 x 896 |
.low | 360 x 640 |
Valid values: 2, 7, 15, 24, 30 FPS.
Lower resolution and frame rate yield higher visual quality due to less Bluetooth compression.
StreamState transitions: stopping → stopped → waitingForDevice → starting → streaming → paused
let stateToken = stream.statePublisher.listen { state in
Task { @MainActor in
switch state {
case .streaming:
// Stream is active, frames are flowing
case .waitingForDevice:
// Waiting for glasses to connect
case .stopped:
// Stream ended — release resources
case .paused:
// Temporarily suspended — keep connection, wait
default:
break
}
}
}
let frameToken = stream.videoFramePublisher.listen { frame in
guard let image = frame.makeUIImage() else { return }
Task { @MainActor in
self.previewImage = image
}
}
// Start the stream capability
Task { await stream.start() }
// Stop streaming
Task { await stream.stop() }
// Stop the parent device session when you're done with all capabilities
deviceSession.stop()
Capture a still photo while streaming:
// Listen for photo data
let photoToken = stream.photoDataPublisher.listen { photoData in
let imageData = photoData.data
// Convert to UIImage or save
}
// Trigger capture
stream.capturePhoto(format: .jpeg)
Resolution and frame rate are constrained by Bluetooth Classic bandwidth. The SDK automatically reduces quality when bandwidth is limited:
Request lower settings for higher visual quality per frame.
Set up the Meta glasses SDK and make your first connection.
Manage device session states, pause and resume flows, and availability monitoring.
Build a complete DAT app with camera streaming and photo capture.
Learn Swift conventions, naming, and async patterns for DAT SDK iOS development.
Identify common bugs, version conflicts, and state machine failures faster.
Guide app registration with Meta AI and camera permission request flows.
Set up camera sessions, stream video, capture photos, and tune resolution.
Capture frames or short clips from RTSP and ONVIF cameras.
Build a complete DAT app with sessions, camera streaming, and photo capture.
Record screens and extract keyframes to capture UI motion and transient states.
Connect to workshop ESP32-CAMs to capture photos, check status, and control flash LEDs.
Extract key frames or short clips from videos for analysis and editing.