How sarxos/webcam-capture works
Webcam Capture is a Java API that hides capture-framework differences behind a common camera interface. The principal workflow is to discover a camera, select and configure it, open it, and obtain images; applications can then display, analyze, or stream those images. Drivers cover built-in, network, and framework-specific devices, while the core also provides Swing UI, motion detection, and lifecycle support. The graph reflects documented capabilities and the sampled source; several driver and utility implementations are represented by their exact enclosing directories because their source was not sampled.
Main entry points: WebcamDiscoveryService.java Device Discovery · Webcam.java Camera API · WebcamDriver.java Driver Contract · Application.java Akka Example
Components 20
Capture Core
- Camera API
webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java - Device Discovery
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDiscoveryService.java - Driver Contract
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDriver.java - Device Contract
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDevice.java - Resolution Options
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamResolution.java - Camera Events
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamEvent.java - Resource Lifecycle
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDeallocator.java
Capture Drivers
- Built-in Capture
webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/WebcamDefaultDriver.java - Native Capture
webcam-capture/src/main/java/com/github/sarxos/webcam/ds/buildin/natives/Device.java - IP Cameras
webcam-capture-drivers/driver-ipcam/src/main/java/com/github/sarxos/webcam/ds/ipcam - Framework Drivers
webcam-capture-drivers - Raspberry Pi
webcam-capture-drivers/driver-raspberrypi/src/main/java/com/github/sarxos/webcam/ds/raspberrypi
Image Features
- Motion Detection
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamMotionDetector.java - MJPEG Streaming
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamStreamer.java - Image Transformation
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamImageTransformer.java
Application Interfaces
- Swing Preview
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamPanel.java - Camera Picker
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamPicker.java - Live Stream Example
webcam-capture-examples/webcam-capture-live-streaming/src/main/java/us/sosia/video/stream/agent/StreamClientAgent.java - Akka Example
webcam-capture-examples/webcam-capture-akka/src/main/java/Application.java
Other components
- Java Application
Connections 19
- Java Application → Camera API: uses camera API
README.md - Camera API → Device Discovery: gets devices
webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java - Device Discovery → Driver Contract: scans driver
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDiscoveryService.java - Driver Contract → Device Contract: provides devices
- Built-in Capture → Native Capture: captures natively
- Device Discovery → IP Cameras: discovers cameras
webcam-capture-drivers/driver-ipcam/src/main/java/com/github/sarxos/webcam/ds/ipcam/IpCamDeviceRegistry.java - Device Discovery → Framework Drivers: selects driver
webcam-capture-drivers/driver-ipcam/src/main/java/com/github/sarxos/webcam/ds/ipcam/IpCamDeviceRegistry.java - Device Discovery → Raspberry Pi: discovers cameras
- Java Application → Resolution Options: chooses size
README.md - Java Application → Swing Preview: displays feed
README.md - Java Application → Camera Picker: selects camera
README.md - Java Application → Motion Detection: detects motion
README.md - Java Application → MJPEG Streaming: exposes stream
README.md - Java Application → Image Transformation: transforms images
- Device Discovery → Camera Events: notifies changes
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDiscoveryService.java - Device Discovery → Resource Lifecycle: updates cleanup
webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDiscoveryService.java - Java Application → Akka Example: requests capture
webcam-capture-examples/webcam-capture-akka/src/main/java/Application.java - Akka Example → Camera API: opens and captures
webcam-capture-examples/webcam-capture-akka/src/main/java/Application.java - Java Application → Live Stream Example: views live video