aeyes
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWebcam 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.
- GitHub: https://github.com/elecnix/aeyes
- Crate: https://crates.io/crates/aeyes
- License: MIT
A-Eyes(AI的眼睛)是一个CLI守护进程,可保持摄像头开启以实现即时捕获,无自动曝光/对焦延迟。它维持一个约30 FPS的帧缓冲区,因此捕获可在100ms内完成。
- GitHub: https://github.com/elecnix/aeyes
- Crate: https://crates.io/crates/aeyes
- License: MIT
Locating the binary
查找二进制文件
Check if is already installed:
aeyesbash
which aeyes检查是否已安装:
aeyesbash
which aeyesor
或
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/nullcommand -v aeyes
如果未找到,检查常见的cargo安装位置:
```bash
ls ~/.cargo/bin/aeyes 2>/dev/null
ls /usr/local/bin/aeyes 2>/dev/nullInstalling 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 . Ensure is in your PATH:
~/.cargo/bin/aeyes~/.cargo/binbash
export PATH="$HOME/.cargo/bin:$PATH"Prerequisites: Rust toolchain (rustc 1.75+) must be installed. Check with:
bash
rustc --versionIf 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 .这会将二进制文件安装到。确保在你的PATH中:
~/.cargo/bin/aeyes~/.cargo/binbash
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 statusstart 启动后台守护进程
cams 列出可用摄像头
frame 通过守护进程HTTP API将画面捕获到文件
video 通过守护进程HTTP API捕获视频片段
stop 停止守护进程
status 显示守护进程状态Capturing a webcam image
捕获摄像头图像
1. Start the daemon (if not running)
1. 启动守护进程(如果未运行)
bash
aeyes startThis forks to the background and opens the webcam (~30 FPS frame buffer).
bash
aeyes start这会在后台运行并打开摄像头(约30 FPS帧缓冲区)。
2. Check daemon status
2. 检查守护进程状态
bash
aeyes statusbash
aeyes status3. Capture a frame
3. 捕获画面
bash
undefinedbash
undefinedCustom output path (required - no default path)
自定义输出路径(必填 - 无默认路径)
aeyes frame -o /tmp/my-photo.jpg
undefinedaeyes frame -o /tmp/my-photo.jpg
undefined4. List available cameras
4. 列出可用摄像头
bash
aeyes camsbash
aeyes cams5. Capture a video clip
5. 捕获视频片段
bash
aeyes video -o /tmp/my-clip.avibash
aeyes video -o /tmp/my-clip.avi6. Stop the daemon (optional)
6. 停止守护进程(可选)
bash
aeyes stopbash
aeyes stopQuick capture workflow
快速捕获工作流
bash
undefinedbash
undefinedOne-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"
undefinedaeyes start 2>/dev/null || true
sleep 1
aeyes frame -o /tmp/aeyes-capture.jpg
echo "图像已保存至: /tmp/aeyes-capture.jpg"
undefinedLive 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地址
| Camera | URL |
|---|---|
| Camera 0 | http://localhost:43210/web/0 |
| Camera 1 | http://localhost:43210/web/1 |
| Default camera | http://localhost:43210/web/default |
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
undefinedDisplay 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 &
undefinedgoogle-chrome http://localhost:43210/web/0 2>/dev/null &
undefinedFeatures 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
undefinedGet the MJPEG multipart stream
获取MJPEG多部分流
undefinedundefinedHTTP API reference
HTTP API参考
bash
undefinedbash
undefinedList cameras
列出摄像头
Get a frame
获取画面
curl -o frame.jpg http://localhost:43210/cams/default/frame
curl -o frame.jpg http://localhost:43210/cams/default/frame
Capture a video (query params: max_length, fps)
捕获视频(查询参数: max_length, fps)
curl -o video.avi http://localhost:43210/cams/default/video?max_length=5&fps=15
curl -o video.avi http://localhost:43210/cams/default/video?max_length=5&fps=15
Live MJPEG stream
实时MJPEG流
undefinedundefinedTroubleshooting
故障排除
| Symptom | Cause | Fix |
|---|---|---|
| Not in PATH | Add |
| Build fails | Missing Rust | Install rustup (see above) |
| Daemon fails to start | Webcam in use or port 43210 occupied | Close other apps using camera, check |
| Empty/black capture | Wrong device | Check |
| Permission denied | No video group access | |
| Web UI not loading | Daemon not running | Run |
| 症状 | 原因 | 解决方法 |
|---|---|---|
找不到 | 不在PATH中 | 将 |
| 构建失败 | 缺少Rust | 安装rustup(见上文) |
| 守护进程启动失败 | 摄像头被占用或端口43210被占用 | 关闭其他使用摄像头的应用,检查 |
| 捕获内容为空/黑屏 | 设备错误 | 检查 |
| 权限被拒绝 | 无视频组访问权限 | |
| Web UI无法加载 | 守护进程未运行 | 先运行 |
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多部分实现实时流媒体(支持多个并发查看者)