← 返回
未分类

Photo Capture Skill

Capture a fresh webcam image on macOS, Windows, or Linux. Prefer direct camera capture via ffmpeg so the workflow does not depend on screen-recording, access...
在 macOS、Windows 或 Linux 上捕获网络摄像头图像,首选通过 ffmpeg 直接捕获,避免依赖屏幕录制或访问。
laurc2004 laurc2004 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 350
下载
💾 0
安装
1
版本
#latest

概述

Photo Capture

Use this skill when the user wants a live camera image captured and sent back.

Default Behavior

  1. Prefer direct webcam capture with scripts/capture_webcam.py.
  2. Save output under tmp/ inside the workspace.
  3. Reply with MEDIA:./relative/path.png or MEDIA:./relative/path.jpg so the image is sent back.
  4. Only use the old macOS app-window screenshot path when direct camera capture is unavailable.

Why This Path

Direct camera capture is the default because it works across macOS, Windows, and Linux and does not require pre-configuring screen recording, accessibility, or automation permissions.

The OS may still show a normal one-time camera permission prompt for the terminal or Python process. That is expected and lighter than the old screenshot-based setup.

Primary Command Path

Note: Replace with the actual path where this skill is installed (e.g., ~/.agents/skills/photo-capture or ~/.openclaw/workspace/skills/photo-capture).

List available cameras:

python3 <skill-dir>/scripts/capture_webcam.py --list-devices

Capture from the default camera on any supported OS:

python3 <skill-dir>/scripts/capture_webcam.py --output ./tmp/webcam.jpg

Capture from a specific device:

python3 <skill-dir>/scripts/capture_webcam.py \
  --device "0" \
  --output ./tmp/webcam.jpg

Higher resolution capture:

python3 <skill-dir>/scripts/capture_webcam.py \
  --width 1920 \
  --height 1080 \
  --output ./tmp/webcam-1080p.jpg

Platform Notes

  • macOS: Uses ffmpeg with avfoundation. Auto-selects camera index 0 by default.
  • Windows: Uses ffmpeg with dshow. Auto-selects the first detected video device.
  • Linux: Uses ffmpeg with v4l2. Auto-selects /dev/video0-style devices.

Requirements

  • ffmpeg must be available in PATH.
  • A webcam device must be present.
  • If multiple cameras exist, use --list-devices and then pass --device explicitly.

macOS Fallback

Keep the old app-window screenshot path only as a fallback for macOS environments where direct webcam capture fails.

Photo Booth fallback:

bash <skill-dir>/scripts/capture_via_app.sh \
  --app "Photo Booth" \
  --layout large \
  --capture window \
  --output ./tmp/photobooth-window-large.png

Use that fallback only if the direct ffmpeg path fails or the user explicitly wants the Photo Booth or FaceTime UI visible in the image.

Validation

When updating or debugging this skill:

  1. Run --list-devices on the target OS.
  2. Capture one frame to tmp/.
  3. Confirm the output file exists and is not empty.
  4. On macOS, only reach for the screenshot fallback if direct capture is blocked.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 09:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,650
knowledge-management

Bazi Full Fortune Telling

laurc2004
八字全方位算命 Skill — 排盘引擎 + 六亲十神规则 + 家庭校准 + 八大维度全方位分析模板。
★ 1 📥 273
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 327,348