A tool for synchronously capturing images (including RGB and Depth from Realsense devices) and videos from a variety of camera types (IP cameras, Intel Realsense) using Rust.
This project uses a .env file to manage environment-specific configurations. Before running the application, ensure you have a .env file in the project root. If you have an example file (e.g., .env.example), copy it to .env:
cp .env.example .envThen, source the environment variables:
source .env- For a development build:
cargo build
 - For a release (production) build:
cargo build --release
 
The executable will be located at target/debug/rcam for development builds and target/release/rcam for release builds.
To run the test suite:
cargo testThe main executable is rcam.
Common Flags:
-c, --config <FILE>: Sets a custom configuration file (e.g.,rcam --config config/tatbot.yaml capture-image).-d, --debug: Enables debug logging.
Subcommands:
Captures a single image from specified or all cameras. For Realsense devices, this includes both RGB color and Depth (Z16) images. Captures across all selected devices are triggered to be as synchronous as possible.
- Capture from all cameras:
rcam capture-image
 - Capture from specific cameras (e.g., an IP camera 
front-doorand a Realsense camerarealsense_d405):rcam capture-image --cameras front-door,realsense_d405
 - Specify an output directory:
rcam capture-image --output /path/to/save/images
 - The 
--delayflag is currently ignored forcapture-imageas captures are internally synchronized. - Capture and log to Rerun viewer (IP camera images, Realsense RGB and Depth images):
rcam capture-image --cameras front-door,realsense_d405 --rerun
 
Records a video segment from specified or all cameras.
- Record a 60-second video from all cameras:
rcam capture-video --duration 60
 - Record from specific cameras and set output directory:
rcam capture-video --cameras front-door --duration 120 --output /path/to/save/videos
 - Record a 30-second video from 
cam1and log frames to Rerun viewer:rcam capture-video --cameras cam1 --duration 30 --rerun
 
Verifies time synchronization across all configured cameras.
rcam verify-timesRuns a diagnostic test suite.
rcam testThis tool supports logging images and video frames to the Rerun viewer for enhanced visualization and debugging.
To enable Rerun logging, use the --rerun flag with the capture-image or capture-video subcommands. If the flag is provided, rcam will attempt to spawn a Rerun viewer and stream the captured data to it.
Installing the Rerun Viewer:
The Rerun SDK for Rust (which rcam uses) typically requires a separate installation of the Rerun viewer binary
- Using cargo:
For potentially better video decoding performance, you might need
cargo install rerun-cli --locked
nasminstalled and use:cargo install rerun-cli --locked --features nasm
 
After installation, you should be able to run rerun --help in your terminal.
Refer to the official Rerun documentation for more details on using the Rerun viewer.
You might need to run the executable directly from the target folder if it's not in your PATH:
target/debug/rcam <subcommand> [options](for development)target/release/rcam <subcommand> [options](for release)