首页龙虾技能列表 › FFmpeg — 音视频处理

🎬 FFmpeg — 音视频处理

v1.0.0

使用正确的编解码器选择、滤镜和编码设置处理视频和音频。

5· 3,400·44 当前·46 累计
by @ivangdavila (Iván)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/2/26
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
该技能是仅指令的FFmpeg助手,其需求和指令与其声明的目的一致,不请求无关凭证或风险安装。
评估建议
此技能是仅指令的FFmpeg指南,看起来一致。使用前,确保您从可信来源安装了ffmpeg,并且信任允许代理操作的任何媒体文件。代理将构建并运行ffmpeg命令——执行前审查命令以避免意外覆盖或处理敏感文件。...
详细分析 ▾
用途与能力
Name/description (FFmpeg processing) match the SKILL.md content. The only required binary is ffmpeg, which is exactly what the skill needs to perform the documented tasks.
指令范围
SKILL.md contains usage guidance and example ffmpeg command lines (seeking, mapping, filters, encoding, hardware accel, etc.). It does not instruct the agent to read unrelated system files, environment variables, or to transmit data to external endpoints; examples reference user media files and local lists/subtitle files, which is expected for this functionality.
安装机制
No install spec (instruction-only). Nothing is downloaded or written to disk by the skill itself, which minimizes install-time risk.
凭证需求
The skill requests no environment variables, credentials, or config paths. That is proportionate for a tool that just builds/runs ffmpeg commands locally.
持久化与权限
always is false and the skill does not request persistent agent-level privileges or modify other skills/configs. Autonomous invocation is allowed (platform default) but not an additional privilege here.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

🖥️ OSLinux · macOS · Windows

版本

latestv1.0.02026/2/10

Initial release

● 无害

安装命令 点击复制

官方npx clawhub@latest install ffmpeg
镜像加速npx clawhub@latest install ffmpeg --registry https://cn.clawhub-mirror.com

技能文档

Input Seeking (Major Difference)

  • -ss BEFORE -i: fast seek, may be inaccurate—starts from nearest keyframe
  • -ss AFTER -i: frame-accurate but slow—decodes from start
  • Combine both: -ss 00:30:00 -i input.mp4 -ss 00:00:05—fast seek then accurate trim
  • For cutting, add -avoid_negative_ts make_zero to fix timestamp issues

Stream Selection

  • Default: first video + first audio—may not be what you want
  • Explicit selection: -map 0:v:0 -map 0:a:1—first video, second audio
  • All streams of type: -map 0:a—all audio streams
  • Copy specific: -map 0 -c copy—all streams, no re-encoding
  • Exclude: -map 0 -map -0:s—all except subtitles

Encoding Quality

  • CRF (Constant Rate Factor): lower = better quality, larger file—18-23 typical for H.264
  • -preset: ultrafast to veryslow—slower = smaller file at same quality
  • Two-pass for target bitrate: first pass analyzes, second pass encodes
  • -crf and -b:v mutually exclusive—use one or the other

Container vs Codec

  • Container (MP4, MKV, WebM): wrapper format holding streams
  • Codec (H.264, VP9, AAC): compression algorithm for stream
  • Not all codecs fit all containers—H.264 in MP4/MKV, not WebM; VP9 in WebM/MKV, not MP4
  • Copy codec to new container: -c copy—fast, no quality loss

Filter Syntax

  • Simple: -vf "scale=1280:720"—single filter chain
  • Complex: -filter_complex "[0:v]scale=1280:720[scaled]"—named outputs for routing
  • Chain filters: -vf "scale=1280:720,fps=30"—comma-separated
  • Filter order matters—scale before crop gives different result than crop before scale

Common Filters

  • Scale: scale=1280:720 or scale=-1:720 for auto-width maintaining aspect
  • Crop: crop=640:480:100:50—width:height:x:y from top-left
  • FPS: fps=30—change framerate
  • Trim: trim=start=10:end=20,setpts=PTS-STARTPTS—setpts resets timestamps
  • Overlay: overlay=10:10—position from top-left

Audio Processing

  • Sample rate: -ar 48000—standard for video
  • Channels: -ac 2—stereo
  • Audio codec: -c:a aac -b:a 192k—AAC at 192kbps
  • Normalize: -filter:a loudnorm—EBU R128 loudness normalization
  • Extract audio: -vn -c:a copy output.m4a—no video, copy audio

Concatenation

  • Same codec/params: concat demuxer—-f concat -safe 0 -i list.txt -c copy
  • Different formats: concat filter—-filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1"
  • list.txt format: file 'video1.mp4' per line—escape special characters
  • Different resolutions: scale/pad to match before concat filter

Subtitles

  • Burn-in (hardcode): -vf "subtitles=subs.srt"—cannot be turned off
  • Mux as stream: -c:s mov_text (MP4) or -c:s srt (MKV)—user toggleable
  • From input: -map 0:s—include subtitle streams
  • Extract: -map 0:s:0 subs.srt—first subtitle to file

Hardware Acceleration

  • Decode: -hwaccel cuda or -hwaccel videotoolbox (macOS)
  • Encode: -c:v h264_nvenc (NVIDIA), -c:v h264_videotoolbox (macOS)
  • Not always faster—setup overhead; benefits show on long videos
  • Quality may differ—software encoding often produces better quality

Common Mistakes

  • Forgetting -c copy when not re-encoding—defaults to re-encode, slow and lossy
  • -ss after -i for long videos—takes forever seeking
  • Audio desync after cutting—use -async 1 or -af aresample=async=1
  • Filter on stream copy—filters require re-encoding; -c copy + -vf = error
  • Output extension doesn't set codec—output.mp4 without -c:v uses default, may not be H.264
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务