aeyes 0.1.0

Non-interactive webcam daemon for instant frame and video capture with live streaming
Documentation

A-Eyes 🖼️

Rust Crates.io

A-Eyes (AI's eyes) is a CLI daemon that keeps your webcam open for instant captures without auto-exposure/focus delays. Perfect for AI agents needing quick "eyes".

Features

  • Daemon mode: Open webcam continuously (~30 FPS latest frame buffer).
  • Fast CLI capture: Save latest frame in <100ms.
  • Video capture: Record short video clips in AVI MJPEG format.
  • Live streaming: Real-time MJPEG stream via HTTP with web UI.
  • Multiple clients can stream from the same camera simultaneously.
  • Multiple webcams can stream in parallel.
  • Adaptive Linux exposure control to keep bright screens readable in dark rooms.
  • HTTP API for frame, video, and stream capture.
  • Linux V4L2 backend. Pluggable for Windows/Mac.

Installation

git clone https://github.com/elecnix/aeyes.git
cd aeyes
cargo install --path .

Usage

Start the daemon

aeyes start                    # Start with auto-selected camera
aeyes start --camera 0         # Start with specific camera
aeyes start --bind 0.0.0.0:43210  # Bind to all interfaces

Capture a frame

aeyes frame                    # Saves to aeyes-frame.jpg
aeyes frame -o img.jpg         # Custom output path
aeyes frame --camera 0         # Specific camera

Capture a video clip

aeyes video                                    # 5 second clip at 15 FPS (default)
aeyes video -o clip.avi                        # Custom output path
aeyes video --max-length 10 --fps 30           # 10 second clip at 30 FPS
aeyes video --camera 0 --max-length 3 --fps 24 # Specific camera

HTTP API

# List cameras
curl http://localhost:43210/cams

# Get a frame
curl -o frame.jpg http://localhost:43210/cams/default/frame

# Capture a video (query params: max_length, fps)
curl -o video.avi http://localhost:43210/cams/default/video?max_length=5&fps=15

# Live stream (MJPEG multipart)
curl http://localhost:43210/cams/default/stream

Live Web UI

Open http://localhost:43210/web/0 in a browser to see a live view from camera 0. Use http://localhost:43210/web/default for the daemon-selected camera.

Multiple clients can view the same stream simultaneously without affecting each other.

Inspecting the Webcam

You can view the live webcam feed directly in your browser while the daemon is running:

Camera URL
Camera 0 http://localhost:43210/web/0
Camera 1 http://localhost:43210/web/1
Default camera http://localhost:43210/web/default

Click any link above or ask me to open the browser for you.

Status & stop

aeyes status
aeyes stop

Video Format

Videos are saved as AVI with MJPEG encoding. This format:

  • Works with most video players (VLC, mpv, etc.)
  • Requires no external dependencies for encoding
  • Can be converted to MP4 with ffmpeg if needed:
    ffmpeg -i input.avi -c:v libx264 output.mp4
    

Testing

# Run all tests (42 tests)
cargo test --lib

# Run with single thread (avoids port conflicts)
cargo test --lib -- --test-threads=1

Tests use a FakeBackend that simulates camera capture without requiring actual webcam hardware.

License

MIT