Godot Native Camera Plugin
A Godot plugin that provides a unified camera capture interface for Android and iOS using native platform APIs. It enables real‑time camera frame streaming directly into Godot with configurable resolution, rotation, frame skipping, and optional grayscale output.
Key Features:
- Unified GDScript API for Android and iOS
- Enumerate available cameras and their supported output sizes
- Start and stop native camera frame streaming
- Receive raw frame buffers or ready‑to‑use
Imageobjects - Configurable resolution, rotation, frame skipping, and grayscale capture
- Designed for real‑time use cases (CV, AR preprocessing, custom rendering)
Table of Contents
- Installation
- Usage
- Signals
- Methods
- Classes
- Platform-Specific Notes
- Links
- All Plugins
- Credits
- Contributing
Installation
Before installing this plugin, make sure to uninstall any previous versions of the same plugin.
If installing both Android and iOS versions of the plugin in the same project, ensure that both versions use the same addon interface version.
There are two ways to install the NativeCamera plugin into your project:
- Through the Godot Editor AssetLib
- Manually by downloading archives from GitHub
Installing via AssetLib
Steps:
- Search for NativeCamera in the Godot Editor AssetLib
- Click Download
- In the installation dialog:
- Keep Change Install Folder set to your project root
- Keep Ignore asset root checked
- Click Install
- Enable the plugin from Project → Project Settings → Plugins
When installing both platforms via AssetLib, Godot may warn that some files conflict and will not be installed. This is expected and safe to ignore, as both platforms share the same addon interface code.
Installing manually
Steps:
- Download the release archive from GitHub
- Unzip the archive
- Copy the contents into your Godot project root
- Enable the plugin via Project → Project Settings → Plugins
Usage
Add a NativeCamera node to your main scene or register it as an autoload (singleton).
Typical workflow:
- Query available cameras using
get_cameras() - Choose a camera and desired output size
- Create a
FeedRequestto configure the stream - Start the camera feed
- Receive frames via signals
Example
@onready var camera := $NativeCamera
func _ready():
camera.permission_result.connect(_on_permission_result)
camera.frame_available.connect(_on_frame_available)
camera.request_permission()
func _on_permission_result(granted: bool) -> void:
if not granted:
push_error("Camera permission denied")
return
var cameras := camera.get_cameras()
if cameras.is_empty():
return
var cam: CameraInfo = cameras[0]
var request := FeedRequest.new()
.set_camera_id(cam.get_camera_id())
.set_width(1280)
.set_height(720)
.set_rotation(90)
.set_grayscale(false)
camera.start_feed(request)
func _on_frame_available(frame: FrameInfo) -> void:
var img := frame.get_image()
# Use the image or raw buffer here
Signals
Register listeners on the NativeCamera node:
permission_result(granted: bool)- Emitted after a camera permission request completes
frame_available(frame: FrameInfo)- Emitted when a new camera frame is available
Methods
request_permission()- Requests camera permission from the OS
get_cameras() -> Array[CameraInfo]- Returns a list of available cameras
start(request: FeedRequest)- Starts the camera feed with the given configuration
stop()- Stops the active camera feed
Classes
This section documents the GDScript interface classes implemented and exposed by the plugin.
CameraInfo
Encapsulates camera metadata provided by the mobile OS.
Properties / Methods:
get_camera_id() -> Stringis_front_facing() -> boolget_output_sizes() -> Array[FrameSize]
FeedRequest
Defines configuration parameters for starting a camera feed.
Configurable options:
- Camera ID
- Output width and height
- Frames to skip (performance tuning)
- Rotation (degrees)
- Grayscale capture
Supports fluent chaining via setter methods.
FrameInfo
Represents a single captured frame.
Accessors:
get_buffer() -> PackedByteArrayget_width() -> intget_height() -> intget_rotation() -> intis_grayscale() -> boolget_image() -> Image
FrameSize
Represents a supported camera output resolution.
Accessors:
get_width() -> intget_height() -> intget_raw_data() -> Dictionary
Platform-Specific Notes
Android
- Ensure Android export templates are installed
- Enable Gradle build in export settings
- Camera permission is required at runtime
Troubleshooting:
- Logs (Linux/macOS):
adb logcat | grep godot - Logs (Windows):
adb.exe logcat | select-string "godot"
Helpful resources:
- Godot Android export documentation
- Android Studio & ADB documentation
iOS
- Follow Godot’s iOS export instructions
- Camera permission must be declared in the generated Xcode project
- Use Xcode console logs for debugging
Links
All Plugins
| Plugin | Android | iOS | Free | Open Source | License |
|---|---|---|---|---|---|
| Admob | ✅ | ✅ | ✅ | ✅ | MIT |
| Notification Scheduler | ✅ | ✅ | ✅ | ✅ | MIT |
| Deeplink | ✅ | ✅ | ✅ | ✅ | MIT |
| Share | ✅ | ✅ | ✅ | ✅ | MIT |
| In-App Review | ✅ | ✅ | ✅ | ✅ | MIT |
| Native Camera | ✅ | ✅ | ✅ | ✅ | MIT |
| Connection State | ✅ | ✅ | ✅ | ✅ | MIT |
| OAuth 2.0 | ✅ | ✅ | ✅ | ✅ | MIT |
| QR | ✅ | ✅ | ✅ | ✅ | MIT |
| Firebase | ✅ | ✅ | ✅ | ✅ | MIT |
Credits
Developed by Cengiz
Based on Godot Mobile Plugin Template
Original repository: Godot Native Camera Plugin
Contributing
Contributions are welcome. Please see the contributing guide in the repository for details.
Changelog for version v1.1-Multi
No changelog provided for this version.