aeyes

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Webcam capture with aeyes

使用aeyes捕获摄像头内容

Use this skill when the user wants to capture an image or video from their webcam, or view a live stream.
当用户想要从摄像头捕获图像或视频,或者查看实时流时,使用此技能。

What is aeyes?

什么是aeyes?

A-Eyes (AI's eyes) is a CLI daemon that keeps your webcam open for instant captures without auto-exposure/focus delays. It maintains a ~30 FPS frame buffer, so captures complete in under 100ms.
A-Eyes(AI的眼睛)是一个CLI守护进程,可保持摄像头开启以实现即时捕获,无自动曝光/对焦延迟。它维持一个约30 FPS的帧缓冲区,因此捕获可在100ms内完成。

Locating the binary

查找二进制文件

Check if
aeyes
is already installed:
bash
which aeyes
检查
aeyes
是否已安装:
bash
which aeyes

or

command -v aeyes

If not found, check common cargo install locations:

```bash
ls ~/.cargo/bin/aeyes 2>/dev/null
ls /usr/local/bin/aeyes 2>/dev/null
command -v aeyes

如果未找到,检查常见的cargo安装位置:

```bash
ls ~/.cargo/bin/aeyes 2>/dev/null
ls /usr/local/bin/aeyes 2>/dev/null

Installing from source

从源码安装

If aeyes is not installed, build it from GitHub:
bash
git clone https://github.com/elecnix/aeyes.git /tmp/aeyes
cd /tmp/aeyes
cargo install --path .
This installs the binary to
~/.cargo/bin/aeyes
. Ensure
~/.cargo/bin
is in your PATH:
bash
export PATH="$HOME/.cargo/bin:$PATH"
Prerequisites: Rust toolchain (rustc 1.75+) must be installed. Check with:
bash
rustc --version
If Rust is not installed:
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
如果未安装aeyes,从GitHub构建:
bash
git clone https://github.com/elecnix/aeyes.git /tmp/aeyes
cd /tmp/aeyes
cargo install --path .
这会将二进制文件安装到
~/.cargo/bin/aeyes
。确保
~/.cargo/bin
在你的PATH中:
bash
export PATH="$HOME/.cargo/bin:$PATH"
前置条件:必须安装Rust工具链(rustc 1.75+)。使用以下命令检查:
bash
rustc --version
如果未安装Rust:
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Available commands

可用命令

start   Start the background daemon
cams    List available cameras
frame   Capture a frame to a file through the daemon HTTP API
video   Capture a video clip through the daemon HTTP API
stop    Stop the daemon
status  Show daemon status
start   启动后台守护进程
cams    列出可用摄像头
frame   通过守护进程HTTP API将画面捕获到文件
video   通过守护进程HTTP API捕获视频片段
stop    停止守护进程
status  显示守护进程状态

Capturing a webcam image

捕获摄像头图像

1. Start the daemon (if not running)

1. 启动守护进程(如果未运行)

bash
aeyes start
This forks to the background and opens the webcam (~30 FPS frame buffer).
bash
aeyes start
这会在后台运行并打开摄像头(约30 FPS帧缓冲区)。

2. Check daemon status

2. 检查守护进程状态

bash
aeyes status
bash
aeyes status

3. Capture a frame

3. 捕获画面

bash
undefined
bash
undefined

Custom output path (required - no default path)

自定义输出路径(必填 - 无默认路径)

aeyes frame -o /tmp/my-photo.jpg
undefined
aeyes frame -o /tmp/my-photo.jpg
undefined

4. List available cameras

4. 列出可用摄像头

bash
aeyes cams
bash
aeyes cams

5. Capture a video clip

5. 捕获视频片段

bash
aeyes video -o /tmp/my-clip.avi
bash
aeyes video -o /tmp/my-clip.avi

6. Stop the daemon (optional)

6. 停止守护进程(可选)

bash
aeyes stop
bash
aeyes stop

Quick capture workflow

快速捕获工作流

bash
undefined
bash
undefined

One-liner: ensure daemon is running, capture, return path

一行命令:确保守护进程运行,捕获画面,返回路径

aeyes start 2>/dev/null || true sleep 1 aeyes frame -o /tmp/aeyes-capture.jpg echo "Image saved to: /tmp/aeyes-capture.jpg"
undefined
aeyes start 2>/dev/null || true sleep 1 aeyes frame -o /tmp/aeyes-capture.jpg echo "图像已保存至: /tmp/aeyes-capture.jpg"
undefined

Live webcam streaming

摄像头实时流媒体

You can view the live webcam feed directly in your browser while the daemon is running. This is useful for inspecting the webcam or showing the feed to the user.
当守护进程运行时,你可以直接在浏览器中查看摄像头实时馈送。这对于检查摄像头或向用户展示馈送非常有用。

Web UI URLs

Web UI地址

Opening the live stream

打开实时流

Share the URL with the user so they can click it, or open it yourself in a browser:
bash
undefined
将地址分享给用户让他们点击,或者自己在浏览器中打开:
bash
undefined

Display URL for user

向用户展示地址

echo "Live webcam view: http://localhost:43210/web/0"
echo "摄像头实时视图: http://localhost:43210/web/0"

Or open in Chrome (if available)

或在Chrome中打开(如果可用)

google-chrome http://localhost:43210/web/0 2>/dev/null &
undefined
google-chrome http://localhost:43210/web/0 2>/dev/null &
undefined

Features of the web UI

Web UI功能

  • Dark-themed interface
  • Real-time MJPEG stream
  • Status indicator (Connecting/Connected/Stream error)
  • Responsive layout
  • Multiple clients can view the same stream simultaneously
  • 深色主题界面
  • 实时MJPEG流
  • 状态指示器(连接中/已连接/流错误)
  • 响应式布局
  • 多个客户端可同时查看同一流

MJPEG stream endpoint

MJPEG流端点

For programmatic access to the stream:
bash
undefined
用于以编程方式访问流:
bash
undefined

Get the MJPEG multipart stream

获取MJPEG多部分流

HTTP API reference

HTTP API参考

bash
undefined
bash
undefined

List cameras

列出摄像头

Get a frame

获取画面

Capture a video (query params: max_length, fps)

捕获视频(查询参数: max_length, fps)

Live MJPEG stream

实时MJPEG流

Troubleshooting

故障排除

SymptomCauseFix
aeyes
not found
Not in PATHAdd
~/.cargo/bin
to PATH
Build failsMissing RustInstall rustup (see above)
Daemon fails to startWebcam in use or port 43210 occupiedClose other apps using camera, check
aeyes status
Empty/black captureWrong deviceCheck
/dev/video*
devices
Permission deniedNo video group access
sudo usermod -aG video $USER
then logout/login
Web UI not loadingDaemon not runningRun
aeyes start
first
症状原因解决方法
找不到
aeyes
不在PATH中
~/.cargo/bin
添加到PATH
构建失败缺少Rust安装rustup(见上文)
守护进程启动失败摄像头被占用或端口43210被占用关闭其他使用摄像头的应用,检查
aeyes status
捕获内容为空/黑屏设备错误检查
/dev/video*
设备
权限被拒绝无视频组访问权限
sudo usermod -aG video $USER
然后注销/重新登录
Web UI无法加载守护进程未运行先运行
aeyes start

Platform notes

平台说明

  • Linux: Primary supported platform (uses V4L2/nokhwa)
  • Windows/Mac: Planned but not yet supported (see roadmap)
  • Linux: 主要支持平台(使用V4L2/nokhwa)
  • Windows/Mac: 已规划但暂不支持(查看路线图

IPC details

IPC细节

  • HTTP API:
    http://127.0.0.1:43210
  • The daemon maintains a latest-frame buffer, so captures are instant
  • Adaptive exposure control keeps bright screens readable in dark rooms
  • Live streaming via MJPEG multipart (supports multiple concurrent viewers)
  • HTTP API:
    http://127.0.0.1:43210
  • 守护进程维护最新帧缓冲区,因此捕获是即时的
  • 自适应曝光控制可在黑暗房间中清晰显示明亮屏幕
  • 通过MJPEG多部分实现实时流媒体(支持多个并发查看者)