ffmpeg-master

Use when performing video/audio processing tasks including transcoding, filtering, streaming, metadata manipulation, or complex filtergraph operations with FFmpeg.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "ffmpeg-master" with this command: npx skills add liudu2326526/ffmpeg-master

FFmpeg Master

Comprehensive guide for professional video and audio manipulation using FFmpeg and FFprobe.

Core Concepts

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play almost anything that humans and machines have created. It is a command-line tool that processes streams through a complex pipeline of demuxers, decoders, filters, encoders, and muxers.

Common Operations

# Basic Transcoding (MP4 to MKV)
ffmpeg -i input.mp4 output.mkv

# Change Video Codec (to H.265/HEVC)
ffmpeg -i input.mp4 -c:v libx265 -crf 28 -c:a copy output.mp4

# Extract Audio (No Video)
ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3

# Resize/Scale Video
ffmpeg -i input.mp4 -vf "scale=1280:720" output.mp4

# Cut Video (Start at 10s, Duration 30s)
ffmpeg -i input.mp4 -ss 00:00:10 -t 00:00:30 -c copy output.mp4

# Fast Precise Cut (Re-encoding only the cut points is complex, so standard re-encoding is safer for precision)
ffmpeg -ss 00:00:10 -i input.mp4 -to 00:00:40 -c:v libx264 -crf 23 -c:a aac output.mp4

# Concatenate Files (using demuxer)
# Create filelist.txt: file 'part1.mp4' \n file 'part2.mp4'
ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4

# Speed Up/Slow Down Video (2x speed)
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

Processing Categories & When to Use

Codecs & Quality

OptionUse When
-c:v libx264Standard H.264 encoding (best compatibility)
-c:v libx265H.265/HEVC encoding (best compression/quality)
-crf [0-51]Constant Rate Factor (lower is higher quality, 18-28 recommended)
-presetEncoding speed vs compression (ultrafast, medium, veryslow)
-c:a copyPass-through audio without re-encoding (saves time/quality)

Filters & Manipulation

FilterUse When
scaleChanging resolution (e.g., scale=1920:-1 for 1080p width)
cropRemoving edges (e.g., crop=w:h:x:y)
transposeRotating video (1=90deg CW, 2=90deg CCW)
fpsChanging frame rate (e.g., fps=30)
drawtextAdding text overlays/watermarks
overlayPicture-in-picture or adding image watermarks
fadeAdding fade-in/out effects (e.g., fade=in:0:30 for first 30 frames)
volumeAdjusting audio levels (e.g., volume=1.5 for 150% volume)
setptsChanging video speed (e.g., setpts=0.5*PTS for double speed)
atempoChanging audio speed without pitch shift (0.5 to 2.0)

Inspection & Metadata

Tool/OptionUse When
ffprobe -v error -show_format -show_streamsGetting detailed technical info of a file
-metadata title="Name"Setting global metadata tags
-mapSelecting specific streams (e.g., -map 0:v:0 -map 0:a:1)

Advanced: Complex Filtergraphs

Use filter_complex when you need to process multiple inputs or create non-linear filter chains.

# Example: Adding a watermark at the bottom right
ffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=main_w-overlay_w-10:main_h-overlay_h-10" output.mp4

# Example: Vertical Stack (2 videos)
ffmpeg -i top.mp4 -i bottom.mp4 -filter_complex "vstack=inputs=2" output.mp4

# Example: Side-by-Side (2 videos)
ffmpeg -i left.mp4 -i right.mp4 -filter_complex "hstack=inputs=2" output.mp4

# Example: Grid (4 videos 2x2)
ffmpeg -i v1.mp4 -i v2.mp4 -i v3.mp4 -i v4.mp4 -filter_complex "[0:v][1:v]hstack=inputs=2[top];[2:v][3:v]hstack=inputs=2[bottom];[top][bottom]vstack=inputs=2" output.mp4

# Example: Fade Transition (Simple crossfade between two clips)
# Requires manual offset calculation, using xfade is better
ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "xfade=transition=fade:duration=1:offset=9" output.mp4

Hardware Acceleration

PlatformCodecCommand
NVIDIA (NVENC)H.264-c:v h264_nvenc
Intel (QSV)H.264-c:v h264_qsv
Apple (VideoToolbox)H.265-c:v hevc_videotoolbox

Constraints & Error Handling

  • Stream Mapping: Always use -map for complex files to ensure you get the right audio/subtitle tracks.
  • Seeking: Put -ss before -i for fast seeking (input seeking), or after -i for accurate seeking (output seeking).
  • Format Support: Ensure the output container (extension) supports the codecs you've chosen.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Charging Ledger

充电记录账本 - 从截图提取充电信息并记录,支持按周、月查询汇总。**快速暗号**: 充电记录、充电账本、充电汇总。**自然触发**: 记录充电、查询充电费用、充电统计。

Registry SourceRecently Updated
General

qg-skill-sync

从团队 Git 仓库同步最新技能到本机 OpenClaw。支持首次设置、定时自动更新、手动同步和卸载。当用户需要同步技能、设置技能同步、安装或更新团队技能,或提到「技能同步」「同步技能」时使用。

Registry SourceRecently Updated
General

Ad Manager

广告投放管理 - 自动管理广告投放、优化ROI、生成报告。适合:营销人员、电商运营。

Registry SourceRecently Updated