Overview
- Skill Key
- cld1994/raspberry-pi-camera-service
- Author
- cld1994
- Source Repo
- openclaw/skills
- Version
- -
- Source Path
- skills/cld1994/raspberry-pi-camera-service
- Latest Commit SHA
- 71928eba5917de14063183122a4eb4ccaa21615b
提供使用摄像头拍照, 录制视频或直接生成gif的能力。何时触发: 需要拍照时, 需要观察一段时间当前视野时, 需要关注某件事情的进展时.
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 raspberry-pi-camera-service 技能。 若已安装,则直接安装 raspberry-pi-camera-service 技能。
# Raspberry Pi Camera Service Skill
## 概述
树莓派摄像头服务提供基于HTTP的树莓派摄像头硬件(CSI或USB)控制,具备以下高级功能:
- 多格式视频录制(H264、MP4、GIF)
- 带心跳监控的会话管理
- 自动超时保护
- 后台转换任务
- 视频文件管理(列表、下载、删除)
## 架构
该服务由三个主要组件组成:
1. **摄像头管理器(Camera Manager)** - 处理底层摄像头硬件(通过Picamera2使用CSI接口,通过FFmpeg使用USB接口)
2. **转换器(Converter)** - 使用FFmpeg将原始H264转换为其他格式(MP4、GIF)
3. **服务(Service)** - 使用FastAPI构建的HTTP API服务器,具备会话管理功能
## 客户端
客户端SDK会在服务端部署时自动安装到本地
## 服务端部署
可通过执行 `python -c "from camera_client import CameraClient"`来判断服务是否被成功部署
如果发现服务还未部署,则立刻阅读 `references/deploy_service.md` 进行部署
### 快速开始
#### 拍照
```python
from camera_client import CameraClient
with CameraClient() as client:
result = client.capture(task_name="snapshot")
print(f"✅ {result['image_path']}")
```
#### 录制 MP4 视频
```python
from camera_client import CameraClient
client = CameraClient()
try:
# 录制 5 秒的 1080p 视频
result = client.record_video(
duration=5,
task_name="demo_video",
output_format="mp4"
)
print(f"录制完成: {result['video_path']}")
print(f"文件大小: {result['file_size_bytes'] / 1024 / 1024:.2f} MB")
finally:
client.session.close()
```
#### 录制 GIF 动图
```python
from camera_client import CameraClient
client = CameraClient()
try:
# 录制 3 秒的高质量 GIF
result = client.record_gif(
duration=3,
width=480, # 480 像素宽
fps=15, # 15 帧/秒
quality=7, # 高质量
loop=True # 循环播放
)
print(f"GIF 录制完成: {result['video_path']}")
finally:
client.session.close()
```
#### 手动控制录制流程
```python
from camera_client import CameraClient
import time
client = CameraClient()
try:
# 1. 开始录制
result = client.start_recording(...
human-pages-ai
Search and hire real humans for tasks — photography, delivery, research, and more
zseven-w
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.
capt-marbles
Attio CRM integration for managing companies, people, deals, notes, tasks, and custom objects. Use when working with Attio CRM data, searching contacts, managing sales pipelines, adding notes to records, creating tasks, or syncing prospect information.
capt-marbles
Web scraping and crawling with Firecrawl API. Fetch webpage content as markdown, take screenshots, extract structured data, search the web, and crawl documentation sites. Use when the user needs to scrape a URL, get current web info, capture a screenshot, extract specific data from pages, or crawl docs for a framework/library.
caqlayan
Tweet Processor Skill
carlosarturoleon
Connect to Windsor.ai MCP for natural language access to 325+ data sources including Facebook Ads, GA4, HubSpot, Shopify, and more.