Skip to content

Godot GDExtension plugin that extend CameraServer support to multiple platforms.

License

Notifications You must be signed in to change notification settings

j20001970/godot-cameraserver-extension

Repository files navigation

CameraServerExtension

CameraServerExtension is a Godot 4.4+ plugin that extends the support of original CameraServer to multiple platforms.

Usage

CameraServerExtension class will be available to Godot once the plugin is loaded, after creating a CameraServerExtension instance, it can be used for checking camera access permission and making permission request, newly created CameraFeedExtension can be found in CameraServer.

var camera_extension := CameraServerExtension.new()
# Check camera permission
if camera_extension.permission_granted():
    # All good
    pass
else:
    camera_extension.request_permission()
# Check new camera feeds
print(CameraServer.feeds())

Support Status

Platform Backend Formats Notes
Android Camera2 (CPU-based)
  • JPEG
-
Linux PipeWire
  • YUY2
  • YVYU
  • UYVY
  • VYUY
-
iOS AVFoundation - Untested
macOS -
Windows Media Foundation
  • YUY2
  • NV12
  • MJPG
-
Web - - -

Known Issues

  • Avoid upcasting CameraFeedExtension to CameraFeed, otherwise get_formats and set_format will not work.
var feed := CameraServer.get_feed(0) # Returned feed will not work if it is CameraFeedExtension
var feed: CameraFeed = CameraServer.get_feed(0) # Same as above
var feed = CameraServer.get_feed(0) # Both CameraFeed and CameraFeedExtension will work