Skip to content

hu-po/rcam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rcam 📸

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.

Environment Variables ⚙️

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 .env

Then, source the environment variables:

source .env

Building 🛠️

  • 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.

Testing 🧪

To run the test suite:

cargo test

Example Usage 🚀

The 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:

capture-image 🖼️

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-door and a Realsense camera realsense_d405):
    rcam capture-image --cameras front-door,realsense_d405
  • Specify an output directory:
    rcam capture-image --output /path/to/save/images
  • The --delay flag is currently ignored for capture-image as 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

capture-video 📹

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 cam1 and log frames to Rerun viewer:
    rcam capture-video --cameras cam1 --duration 30 --rerun

verify-times ⏱️

Verifies time synchronization across all configured cameras.

rcam verify-times

test 🩺

Runs a diagnostic test suite.

rcam test

Rerun Integration 📊

This 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:
    cargo install rerun-cli --locked
    For potentially better video decoding performance, you might need nasm installed 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)

About

poe ip cameras + realsesnses with rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published