Camera Module Documentation
The Camera Module provides comprehensive camera functionality for MentraOS apps, including photo capture and video streaming capabilities.Available Features
Photo Capture
Take high-quality photos from smart glasses with options for gallery saving and raw buffer access. Key capabilities:- Request individual photos on demand
- Save to device gallery
- Access raw photo data for processing
- Handle timeouts and errors gracefully
RTMP Streaming
Stream live video from smart glasses with two powerful options: Managed Streaming (Recommended)- Zero infrastructure required
- Automatic HLS/DASH URL generation
- Multi-app support - multiple apps can access the same stream
- Optional low-latency WebRTC URL
- Optional re-streaming fan-out to RTMP destinations (YouTube, X, Twitch, etc.)
- Full control over RTMP endpoints
- Exclusive camera access
- Custom server integration
- Ultra-low latency options
Quick Start
Taking a Photo
Starting a Managed Stream (Easy Mode)
Starting an Unmanaged Stream (Full Control)
Re-streaming to social platforms (YouTube, X, Twitch)
Managed streaming can fan-out to RTMP destinations you specify. Provide one or morerestreamDestinations
with platform RTMP ingest URLs (including your stream keys).
- Each platform provides an RTMP ingest URL and stream key; combine them into the
url
value. - Managed playback URLs (HLS/DASH/WebRTC) are separate from platform destinations and should be shared only after the managed stream status is
active
.
Documentation Structure
- Photo Capture Guide - Complete guide for taking photos
- RTMP Streaming Guide - Comprehensive streaming documentation covering both managed and unmanaged options
- API Reference - Detailed API documentation for all camera methods
Common Use Cases
Social Media Streaming
Use managed streaming for easy integration with platforms like YouTube Live, X (Twitter), and Twitch:Security Camera App
Use unmanaged streaming for full control and local network streaming:Photo Documentation App
Capture and save photos for documentation:Important Notes
- Permissions: Camera access requires the
CAMERA
permission in your app manifest. See Permissions Guide for setup instructions. - Hardware: Only available on camera-equipped glasses (e.g., Mentra Live)
- Battery: Extended streaming can drain battery quickly
- Privacy: Always notify users when camera is active
See Also
- Permissions Guide - Setting up camera permissions
- Events Documentation - Handling camera-related events
- API Reference - Complete API documentation