Getting Started
Welcome! I'm here to help you compress video files using FFmpeg — whether you need to slash file sizes for web delivery, optimize footage for mobile, or batch-process a whole folder. Tell me about your video and what you're trying to achieve, and let's get compressing!
Try saying:
- - "Compress this 1.8GB MP4 to under 300MB while keeping it looking good enough for YouTube"
- "What FFmpeg command should I use to compress a 4K MOV file to 1080p H.265 for web streaming?"
- "I need to reduce the file size of 20 videos in a folder — give me a batch FFmpeg compression command"
Quick Start Setup
This skill connects to a cloud processing backend. On first use, set up the connection automatically and let the user know ("Connecting...").
Token check: Look for NEMO_TOKEN in the environment. If found, skip to session creation. Otherwise:
- - Generate a UUID as client identifier
- POST
https://mega-api-prod.nemovideo.ai/api/auth/anonymous-token with X-Client-Id header - Extract
data.token from the response — this is your NEMO_TOKEN (100 free credits, 7-day expiry)
Session: POST https://mega-api-prod.nemovideo.ai/api/tasks/me/with-session/nemo_agent with Bearer auth and body {"task_name":"project"}. Keep the returned session_id for all operations.
Let the user know with a brief "Ready!" when setup is complete. Don't expose tokens or raw API output.
Compress Any Video Smarter, Not Harder
Video files grow fast — a single 4K recording can balloon into gigabytes before you've even finished editing. The ffmpeg-compress-video skill gives you a conversational way to tackle that problem, letting you describe what you need in plain language and get back precise FFmpeg commands or direct compression results without digging through documentation.
Whether you're reducing a 2GB MP4 down to a streaming-friendly 200MB, converting MOV files for web upload, or batch-compressing footage for a client delivery, this skill understands context. It factors in your target file size, acceptable quality loss, intended platform, and source format to recommend the right combination of codec (H.264, H.265, VP9), CRF values, and audio settings.
This isn't a one-size-fits-all compressor. It adapts to your workflow — whether you're a developer automating a media pipeline, a YouTuber trimming upload times, or an archivist preserving footage at manageable sizes. You describe the goal; the skill handles the technical heavy lifting.
Routing Your Compression Requests
When you submit a video for compression, ClawHub parses your target bitrate, codec preference (H.264, H.265, AV1), and quality parameters like CRF value to route your job to the appropriate FFmpeg processing pipeline.
| User says... | Action | Skip SSE? |
|---|
| "export" / "导出" / "download" / "send me the video" | → §3.5 Export | ✅ |
| "credits" / "积分" / "balance" / "余额" |
→ §3.3 Credits | ✅ |
| "status" / "状态" / "show tracks" | → §3.4 State | ✅ |
| "upload" / "上传" / user sends file | → §3.2 Upload | ✅ |
| Everything else (generate, edit, add BGM…) | → §3.1 SSE | ❌ |
Cloud Processing API Reference
The backend spins up isolated FFmpeg instances that handle transcoding with configurable presets — from ultrafast to veryslow — balancing encode time against compression efficiency. Your source container format, audio stream settings, and pixel format are preserved or remuxed according to the output spec you define.
Skill attribution — read from this file's YAML frontmatter at runtime:
- -
X-Skill-Source: INLINECODE8 - INLINECODE9 : from frontmatter INLINECODE10
- INLINECODE11 : detect from install path (
~/.clawhub/ → clawhub, ~/.cursor/skills/ → cursor, else unknown)
All requests must include: Authorization: Bearer <NEMO_TOKEN>, X-Skill-Source, X-Skill-Version, X-Skill-Platform. Missing attribution headers will cause export to fail with 402.
API base: INLINECODE21
Create session: POST /api/tasks/me/with-session/nemo_agent — body {"task_name":"project","language":"<lang>"} — returns task_id, session_id.
Send message (SSE): POST /run_sse — body {"app_name":"nemo_agent","user_id":"me","session_id":"<sid>","new_message":{"parts":[{"text":"<msg>"}]}} with Accept: text/event-stream. Max timeout: 15 minutes.
Upload: POST /api/upload-video/nemo_agent/me/<sid> — file: multipart -F "files=@/path", or URL: INLINECODE31
Credits: GET /api/credits/balance/simple — returns available, frozen, INLINECODE35
Session state: GET /api/state/nemo_agent/me/<sid>/latest — key fields: data.state.draft, data.state.video_infos, INLINECODE39
Export (free, no credits): POST /api/render/proxy/lambda — body {"id":"render_<ts>","sessionId":"<sid>","draft":<json>,"output":{"format":"mp4","quality":"high"}}. Poll GET /api/render/proxy/lambda/<id> every 30s until status = completed. Download URL at output.url.
Supported formats: mp4, mov, avi, webm, mkv, jpg, png, gif, webp, mp3, wav, m4a, aac.
SSE Event Handling
| Event | Action |
|---|
| Text response | Apply GUI translation (§4), present to user |
| Tool call/result |
Process internally, don't forward |
|
heartbeat / empty
data: | Keep waiting. Every 2 min: "⏳ Still working..." |
| Stream closes | Process final response |
~30% of editing operations return no text in the SSE stream. When this happens: poll session state to verify the edit was applied, then summarize changes to the user.
Backend Response Translation
The backend assumes a GUI exists. Translate these into API actions:
| Backend says | You do |
|---|
| "click [button]" / "点击" | Execute via API |
| "open [panel]" / "打开" |
Query session state |
| "drag/drop" / "拖拽" | Send edit via SSE |
| "preview in timeline" | Show track summary |
| "Export button" / "导出" | Execute export workflow |
Draft field mapping: t=tracks, tt=track type (0=video, 1=audio, 7=text), sg=segments, d=duration(ms), m=metadata.
CODEBLOCK0
Error Handling
| Code | Meaning | Action |
|---|
| 0 | Success | Continue |
| 1001 |
Bad/expired token | Re-auth via anonymous-token (tokens expire after 7 days) |
| 1002 | Session not found | New session §3.0 |
| 2001 | No credits | Anonymous: show registration URL with
?bind=<id> (get
<id> from create-session or state response when needed). Registered: "Top up credits in your account" |
| 4001 | Unsupported file | Show supported formats |
| 4002 | File too large | Suggest compress/trim |
| 400 | Missing X-Client-Id | Generate Client-Id and retry (see §1) |
| 402 | Free plan export blocked | Subscription tier issue, NOT credits. "Register or upgrade your plan to unlock export." |
| 429 | Rate limit (1 token/client/7 days) | Retry in 30s once |
Integration Guide
The ffmpeg-compress-video skill is designed to fit into real production workflows without friction. If you're using it to generate FFmpeg commands, you can copy the output directly into your terminal, a shell script, or a CI/CD pipeline step. Commands follow standard FFmpeg syntax and are compatible with FFmpeg 4.x and above on Linux, macOS, and Windows.
For developers building automated media pipelines, this skill works well alongside tools like Node.js child_process, Python's subprocess module, or Docker-based FFmpeg containers. Simply pass the generated command as a string to your execution layer. If you're using a task queue like Celery or BullMQ, the commands slot in cleanly as job payloads.
When integrating into a web app or SaaS product, consider pairing this skill with cloud storage triggers — for example, compressing video automatically when a file lands in an S3 bucket or Google Cloud Storage folder. The skill can generate commands tuned for specific output destinations, including HLS streaming segments or progressive MP4 for CDN delivery.
Troubleshooting
If your compressed video looks blocky or pixelated, the CRF value is likely set too high. For H.264, a CRF between 18–23 gives a good quality-to-size balance; going above 28 typically produces noticeable artifacts. Ask the skill to regenerate the command with a lower CRF if quality is the priority.
Audio desync after compression is a common issue when the source file has a variable frame rate (VFR). Mention that your source is screen-recorded or came from a mobile device — the skill will include the -vsync vfr or -r flag to normalize the frame rate and keep audio aligned.
If FFmpeg throws a 'codec not supported' error, your installed build may be missing certain encoders (like libx265 or libvpx). The skill can suggest an alternative codec or provide instructions for installing a full-featured FFmpeg build via package managers like Homebrew, apt, or through a static binary download.
For files that refuse to compress smaller despite high CRF values, the source may already be heavily compressed. In this case, ask the skill about resolution downscaling or audio bitrate reduction as alternative size-reduction strategies.
Use Cases
Content creators uploading to YouTube, Instagram Reels, or TikTok often hit platform file size or bitrate limits. The ffmpeg-compress-video skill helps dial in the exact settings each platform prefers — for instance, H.264 at a 8Mbps cap for YouTube or a sub-15MB MP4 for Instagram direct upload.
Software teams recording screen captures for documentation or bug reports end up with massive files from tools like OBS or Loom exports. This skill trims those recordings down to a fraction of their original size while keeping text and UI elements sharp enough to read.
Filmmakers and video editors working with raw or proxy footage use this skill to create lightweight review copies for client approval — compressing 10-bit ProRes files into H.264 proxies that play smoothly on any device without sending a 40GB file over email.
Archivists and educators managing large video libraries use batch compression workflows to reduce storage costs. The skill can generate looped FFmpeg commands that process entire directories, applying consistent compression settings across hundreds of files in a single run.
快速入门
欢迎!我在这里帮助你使用 FFmpeg 压缩视频文件——无论你是需要大幅减小文件体积以便网络传输、为移动设备优化素材,还是批量处理整个文件夹。告诉我你的视频情况和目标,让我们开始压缩吧!
试试这样说:
- - 把这个 1.8GB 的 MP4 压缩到 300MB 以下,同时保持画质足够好,适合上传 YouTube
- 我应该用什么 FFmpeg 命令把 4K MOV 文件压缩成 1080p H.265 用于网络流媒体?
- 我需要将文件夹中的 20 个视频文件缩小体积——给我一个批量 FFmpeg 压缩命令
快速启动设置
本技能连接到一个云端处理后端。首次使用时,自动建立连接并通知用户(正在连接...)。
令牌检查:在环境中查找 NEMO_TOKEN。如果找到,跳转到会话创建。否则:
- - 生成一个 UUID 作为客户端标识符
- 向 https://mega-api-prod.nemovideo.ai/api/auth/anonymous-token 发送 POST 请求,附带 X-Client-Id 头
- 从响应中提取 data.token——这就是你的 NEMO_TOKEN(100 个免费积分,7 天有效期)
会话:使用 Bearer 认证向 https://mega-api-prod.nemovideo.ai/api/tasks/me/with-session/nemoagent 发送 POST 请求,请求体为 {taskname:project}。保存返回的 session_id 用于所有操作。
设置完成后,用简短的准备就绪!通知用户。不要暴露令牌或原始 API 输出。
更智能地压缩任何视频,而非更费力
视频文件增长迅速——一个 4K 录制片段在你完成编辑之前就可能膨胀到数 GB。ffmpeg-compress-video 技能为你提供了一种对话式解决方案,让你用自然语言描述需求,无需翻阅文档就能获得精确的 FFmpeg 命令或直接的压缩结果。
无论你是将 2GB 的 MP4 缩小到适合流媒体的 200MB、转换 MOV 文件用于网页上传,还是为客户交付批量压缩素材,这个技能都能理解上下文。它会考虑你的目标文件大小、可接受的质量损失、目标平台和源格式,推荐合适的编码器组合(H.264、H.265、VP9)、CRF 值和音频设置。
这不是一刀切的压缩工具。它能适应你的工作流程——无论你是自动化媒体管道的开发者、缩短上传时间的 YouTuber,还是以可控大小保存素材的档案管理员。你描述目标,技能处理技术重活。
路由你的压缩请求
当你提交视频进行压缩时,ClawHub 会解析你的目标比特率、编码器偏好(H.264、H.265、AV1)和质量参数(如 CRF 值),将任务路由到相应的 FFmpeg 处理管道。
| 用户说... | 操作 | 跳过 SSE? |
|---|
| export / 导出 / download / send me the video | → §3.5 导出 | ✅ |
| credits / 积分 / balance / 余额 |
→ §3.3 积分 | ✅ |
| status / 状态 / show tracks | → §3.4 状态 | ✅ |
| upload / 上传 / 用户发送文件 | → §3.2 上传 | ✅ |
| 其他所有内容(生成、编辑、添加背景音乐...) | → §3.1 SSE | ❌ |
云端处理 API 参考
后端启动隔离的 FFmpeg 实例,使用可配置的预设(从 ultrafast 到 veryslow)处理转码,在编码时间和压缩效率之间取得平衡。你的源容器格式、音频流设置和像素格式会根据你定义的输出规格进行保留或重新封装。
技能归属——运行时从此文件的 YAML 前置元数据读取:
- - X-Skill-Source:ffmpeg-compress-video
- X-Skill-Version:来自前置元数据 version
- X-Skill-Platform:从安装路径检测(~/.clawhub/ → clawhub,~/.cursor/skills/ → cursor,否则为 unknown)
所有请求必须包含:Authorization: Bearer 、X-Skill-Source、X-Skill-Version、X-Skill-Platform。缺少归属头会导致导出失败,返回 402 错误。
API 基础地址:https://mega-api-prod.nemovideo.ai
创建会话:POST /api/tasks/me/with-session/nemoagent——请求体 {taskname:project,language:}——返回 taskid、sessionid。
发送消息(SSE):POST /runsse——请求体 {appname:nemoagent,userid:me,sessionid:,newmessage:{parts:[{text:}]}},附带 Accept: text/event-stream。最大超时时间:15 分钟。
上传:POST /api/upload-video/nemoagent/me/——文件:multipart -F files=@/path,或 URL:{urls:[],sourcetype:url}
积分:GET /api/credits/balance/simple——返回 available、frozen、total
会话状态:GET /api/state/nemoagent/me//latest——关键字段:data.state.draft、data.state.videoinfos、data.state.generated_media
导出(免费,不消耗积分):POST /api/render/proxy/lambda——请求体 {id:render_,sessionId:,draft:,output:{format:mp4,quality:high}}。每 30 秒轮询 GET /api/render/proxy/lambda/,直到 status = completed。下载 URL 位于 output.url。
支持的格式:mp4、mov、avi、webm、mkv、jpg、png、gif、webp、mp3、wav、m4a、aac。
SSE 事件处理
| 事件 | 操作 |
|---|
| 文本响应 | 应用 GUI 翻译(§4),呈现给用户 |
| 工具调用/结果 |
内部处理,不转发 |
| heartbeat / 空 data: | 继续等待。每 2 分钟:⏳ 仍在处理... |
| 流关闭 | 处理最终响应 |
约 30% 的编辑操作在 SSE 流中不返回文本。发生这种情况时:轮询会话状态以验证编辑已应用,然后向用户总结更改。
后端响应翻译
后端假设存在 GUI。将这些翻译为 API 操作:
| 后端说 | 你执行 |
|---|
| click [button] / 点击 | 通过 API 执行 |
| open [panel] / 打开 |
查询会话状态 |
| drag/drop / 拖拽 | 通过 SSE 发送编辑 |
| preview in timeline | 显示轨道摘要 |
| Export button / 导出 | 执行导出工作流 |
草稿字段映射:t=轨道,tt=轨道类型(0=视频,1=音频,7=文本),sg=片段,d=时长(毫秒),m=元数据。
时间线(3 条轨道):1. 视频:城市延时摄影(0-10 秒)2. 背景音乐:Lo-fi(0-10 秒,35%)3. 标题:城市梦想(0-3 秒)
错误处理
令牌错误/过期 | 通过 anonymous-token 重新认证(令牌 7 天后过期) |
| 1002 | 未找到会话 | 新建会话 §3.0 |
| 2001 | 积分不足 | 匿名用户:显示带有 ?bind=
的注册 URL(需要时从 create-session 或 state 响应获取 )。已注册用户:请在你的账户中充值积分 |
| 4001 | 不支持的文件格式 | 显示支持的格式 |
| 4002 | 文件过大 | 建议压缩/裁剪 |
| 400 | 缺少 X-Client-Id | 生成 Client-Id 并重试(参见 §1) |
| 402 | 免费计划导出被阻止 | 订阅层级问题,非积分问题。注册或升级你的计划以解锁