AutoClipper
Description
Automatically create clips and videos from media files in a specified folder. Uses Agent Swarm for intelligent task delegation and supports cron-based scheduling.
AutoClipper
Automatic Video Clip & Highlight Generator for OpenClaw.
v1.0.0 — Design draft. Automatically scan a folder for media files, create clips/highlights using ffmpeg, and organize output. Cron-ready for scheduled automation.
Installation
CODEBLOCK0
Usage
- - Screen recording highlights: Auto-clip moments from Loom/obsidian recordings
- Meeting recaps: Extract key segments from meeting recordings
- Content creation: Batch-process raw footage into short clips
- Security camera clips: Pull motion-triggered segments from camera feeds
- Gaming highlights: Auto-clip "best of" moments from recordings
CODEBLOCK1
Purpose
AutoClipper enables OpenClaw agents to automatically:
- - Monitor a watch folder for new media files (videos, screen recordings, camera clips)
- Analyze media to understand what's worth clipping (via Agent Swarm delegation)
- Generate clips using ffmpeg (highlights, segments, trimmed videos)
- Produce compilations by stitching multiple clips together
- Schedule runs via cron for fully automated workflows
Architecture
CODEBLOCK2
Components
1. Watch Folder Scanner
- - Monitors a configured input directory
- Filters by file extensions:
.mp4, .mov, .mkv, .avi, INLINECODE4 - Tracks processed files (to avoid re-processing)
- Configurable:
watchFolder, fileExtensions, INLINECODE7
2. Media Analyzer (via Agent Swarm)
- - Delegates analysis to appropriate model (MiniMax for code/technical, Kimi for creative)
- Determines:
- Which segments to clip (timestamp ranges)
- Clip duration targets
- Output format preferences
- - Returns structured clip plan: INLINECODE8
3. Clip Engine (ffmpeg)
- - Trim: Extract segments without re-encoding (fast)
- Transcode: Convert to target format/codec
- Highlight: Auto-detect "interesting" segments (via scene detection)
- Compile: Stitch multiple clips into single video
- Overlay: Add watermarks, timestamps, captions
4. Output Manager
- - Organized output folder structure: INLINECODE9
- Configurable naming: INLINECODE10
- Optional: Notify via OpenClaw message (Discord, WhatsApp, etc.)
5. Cron Scheduler
- - Standalone script for cron integration
- Configurable schedule:
0 * * * * (hourly), 0 9 * * * (daily at 9am) - Dry-run mode for testing
- Lock file to prevent overlapping runs
Configuration (config.json)
CODEBLOCK3
Tools Needed
| Tool | Purpose | Required |
|---|
| ffmpeg | Video transcoding, trimming, clipping | Yes |
| ffprobe |
Media metadata extraction (duration, codec) | Yes |
|
Agent Swarm | Analyze media and determine clip strategy | Yes |
|
OpenClaw message | Send notifications when clips are ready | Optional |
|
OpenClaw nodes | Screen recording capture (live input) | Optional |
|
file system | Watch folder, output management | Yes |
Agent Swarm integration
When AutoClipper finds new media, it delegates analysis:
CODEBLOCK4
Prompt template for media analysis:
CODEBLOCK5
Directory Structure
CODEBLOCK6
Keywords
- - video, clip, clips, highlight, highlights
- trim, cut, extract, segment
- ffmpeg, transcode, encode, convert
- folder, watch, monitor, automation
- cron, schedule, batch, process
- screen recording, meeting, recording
Skill Name Ideas
- 1. AutoClipper ✓ (chosen)
- ClipForge
- MediaMason
- VideoHarvest
- HighlightHub
- ClipStream
- MediaSnip
- AutoTrim
Implementation Phases
Phase 1: Core (MVP)
- - [ ] Folder scanner with extension filtering
- [ ] Basic ffmpeg trim operation
- [ ] Simple processed file tracking
- [ ] CLI entry point
Phase 2: Intelligence
- - [ ] Agent Swarm integration for clip planning
- [ ] Scene detection for auto-highlighting
- [ ] Metadata extraction with ffprobe
Phase 3: Automation
- - [ ] Cron launcher script
- [ ] Continuous watcher mode
- [ ] Notification system
- [ ] Output organization
Phase 4: Advanced
- - [ ] Multi-clip compilation
- [ ] Overlay/watermark support
- [ ] Custom clip templates
- [ ] Node camera integration
Notes
- - Performance: Use
-c copy for fast trimming (no re-encode) - Storage: Auto-cleanup processed files or move to archive
- Error handling: Skip corrupted files gracefully, log failures
- Idempotency: Same input file should not produce duplicate output
AutoClipper
描述
自动从指定文件夹中的媒体文件创建剪辑和视频。利用Agent Swarm进行智能任务分配,并支持基于cron的调度。
AutoClipper
OpenClaw自动视频剪辑与精彩片段生成器。
v1.0.0 — 设计草案。 自动扫描文件夹中的媒体文件,使用ffmpeg创建剪辑/精彩片段,并整理输出。支持cron定时自动化。
安装
bash
添加到crontab(crontab -e)
每小时的第0分钟运行
0
/Users/ghost/.openclaw/workspace/skills/auto-clipper/scripts/run.sh
或每天早上9点运行
0 9
* /Users/ghost/.openclaw/workspace/skills/auto-clipper/scripts/run.sh --output daily
使用场景
- - 屏幕录制精彩片段:自动剪辑Loom/obsidian录制中的关键时刻
- 会议回顾:从会议记录中提取关键片段
- 内容创作:批量处理原始素材为短视频片段
- 安防摄像头片段:从摄像头画面中提取运动触发片段
- 游戏精彩时刻:自动剪辑录制中的最佳时刻
bash
单次运行(扫描并处理)
python3 scripts/auto_clipper.py run
试运行(显示将要处理的内容)
python3 scripts/auto_clipper.py run --dry-run
强制重新处理所有文件
python3 scripts/auto_clipper.py run --force
启动持续监控(非cron模式)
python3 scripts/auto_clipper.py watch
显示状态
python3 scripts/auto_clipper.py status
目的
AutoClipper使OpenClaw代理能够自动:
- - 监控监视文件夹,查找新的媒体文件(视频、屏幕录制、摄像头片段)
- 分析媒体内容,了解哪些值得剪辑(通过Agent Swarm分配)
- 使用ffmpeg生成剪辑(精彩片段、片段、修剪后的视频)
- 制作合集,将多个剪辑拼接在一起
- 通过cron调度运行,实现完全自动化的工作流程
架构
┌─────────────────────────────────────────────────────────────┐
│ AutoClipper 技能 │
├─────────────────────────────────────────────────────────────┤
│ 1. 监视文件夹(可配置的输入路径) │
│ ↓ │
│ 2. 媒体扫描器(查找新文件,按扩展名过滤) │
│ ↓ │
│ 3. Agent Swarm分配(分析 → 剪辑策略) │
│ ↓ │
│ 4. 剪辑引擎(ffmpeg操作) │
│ ↓ │
│ 5. 输出整理器(保存到输出文件夹,可选通知) │
└─────────────────────────────────────────────────────────────┘
组件
1. 监视文件夹扫描器
- - 监控配置的输入目录
- 按文件扩展名过滤:.mp4、.mov、.mkv、.avi、.webm
- 跟踪已处理的文件(避免重复处理)
- 可配置:watchFolder、fileExtensions、processedLog
2. 媒体分析器(通过Agent Swarm)
- - 将分析任务分配给合适的模型(MiniMax用于代码/技术内容,Kimi用于创意内容)
- 确定:
- 需要剪辑的片段(时间戳范围)
- 剪辑时长目标
- 输出格式偏好
- - 返回结构化的剪辑计划:[{start, end, label, priority}]
3. 剪辑引擎(ffmpeg)
- - 修剪:无需重新编码即可提取片段(快速)
- 转码:转换为目标格式/编码器
- 精彩片段:自动检测有趣的片段(通过场景检测)
- 合成:将多个剪辑拼接成单个视频
- 叠加:添加水印、时间戳、字幕
4. 输出管理器
- - 组织化的输出文件夹结构:output/YYYY-MM-DD/
- 可配置的命名规则:{original}-{timestamp}-{index}.mp4
- 可选:通过OpenClaw消息通知(Discord、WhatsApp等)
5. Cron调度器
- - 用于cron集成的独立脚本
- 可配置的调度:0 (每小时)、0 9 *(每天上午9点)
- 试运行模式用于测试
- 锁文件防止重叠运行
配置(config.json)
json
{
watchFolder: ~/Downloads/Recordings,
outputFolder: ~/Videos/Clips,
fileExtensions: [.mp4, .mov, .mkv],
processedLog: logs/processed.json,
clipSettings: {
defaultDuration: 60,
minClipDuration: 10,
maxClipDuration: 300,
outputCodec: h264,
outputFormat: mp4
},
intentRouter: {
enabled: true,
model: openrouter/minimax/minimax-m2.5
},
cron: {
schedule: 0 ,
enabled: false
},
notifications: {
enabled: false,
channel: discord
}
}
所需工具
| 工具 | 用途 | 必需 |
|---|
| ffmpeg | 视频转码、修剪、剪辑 | 是 |
| ffprobe |
媒体元数据提取(时长、编码器) | 是 |
|
Agent Swarm | 分析媒体并确定剪辑策略 | 是 |
|
OpenClaw消息 | 剪辑就绪时发送通知 | 可选 |
|
OpenClaw节点 | 屏幕录制捕获(实时输入) | 可选 |
|
文件系统 | 监视文件夹、输出管理 | 是 |
Agent Swarm集成
当AutoClipper发现新的媒体文件时,它会分配分析任务:
用户任务:分析视频并为会议精彩片段建议剪辑时间戳
→ router.spawn() → sessions_spawn(task, model)
← 返回:[{start: 00:05:30, end: 00:07:45, label: 行动项讨论}, ...]
媒体分析提示模板:
分析此视频文件:{filename}
时长:{duration_seconds}秒
提取:值得剪辑为短视频精彩片段的关键时刻(每个30-90秒)
输出:{starttimestamp, endtimestamp, description}的JSON数组
目录结构
auto-clipper/
├── SKILL.md # 本文件
├── _meta.json # 技能元数据
├── config.json # 配置
├── README.md # 设置说明
├── scripts/
│ ├── auto_clipper.py # 主入口
│ ├── scanner.py # 监视文件夹扫描器
│ ├── clipper.py # ffmpeg封装器
│ ├── analyzer.py # Agent Swarm集成
│ └── run.sh # Cron启动器
└── logs/
└── processed.json # 跟踪已处理的文件
关键词
- - 视频、剪辑、片段、精彩时刻、高光
- 修剪、剪切、提取、片段
- ffmpeg、转码、编码、转换
- 文件夹、监视、监控、自动化
- cron、调度、批量、处理
- 屏幕录制、会议、录制
技能名称建议
- 1. AutoClipper ✓(已选)
- ClipForge
- MediaMason
- VideoHarvest
- HighlightHub
- ClipStream
- MediaSnip
- AutoTrim
实施阶段
第一阶段:核心(MVP)
- - [ ] 带扩展名过滤的文件夹扫描器
- [ ] 基本的ffmpeg修剪操作
- [ ] 简单的已处理文件跟踪
- [ ] CLI入口点
第二阶段:智能化
- - [ ] Agent Swarm集成用于剪辑规划
- [ ] 自动高亮的场景检测
- [ ] 使用ffprobe提取元数据
第三阶段:自动化
- - [ ] Cron启动器脚本
- [ ] 持续监控模式
- [ ] 通知系统
- [ ] 输出组织
第四阶段:高级功能
- - [ ] 多剪辑合成
- [ ] 叠加/水印支持
- [ ] 自定义剪辑模板
- [ ] 节点摄像头集成
##