agentleFS
claude-worldclaude-world/claude-agent/.claude/skills/video-extract/SKILL.md

video-extract

Skill5 starsChanged 8 months agoMITView on GitHub

Extract frames, clips, and audio from video files using ffmpeg. Convert between formats, trim segments, create thumbnails, extract subtitles, and batch process. Use when user says "extract frames from video", "clip this segment", "convert to mp4", "get audio from video", "create thumbnail", or any video processing task.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check if ffmpeg is installed first: which ffmpeg

    line 138
  2. Very specific:

    If not installed, show brew install ffmpeg and stop

    line 139
  3. Very specific:

    Always use -y flag to avoid interactive prompts

    line 140
  4. Very specific:

    Use -c copy for lossless clip extraction when possible (much faster)

    line 141
  5. Distinctive:

    Default output goes in the same directory as input with a descriptive suffix

    line 143
  6. Distinctive:

    When extracting many frames, create a subdirectory to avoid clutter

    line 144

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Video Extract

Process video files with ffmpeg: extract frames, clips, audio, and more.

Prerequisites

Install ffmpeg:

brew install ffmpeg

Verify: ffmpeg -version

Commands

Video Info

ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
# Quick summary:
ffprobe -v error -show_entries format=duration,size,bit_rate \
  -show_entries stream=codec_name,width,height,r_frame_rate input.mp4

Extract Frames

# Single frame at timestamp
ffmpeg -y -i input.mp4 -ss 00:01:30 -vframes 1 frame.jpg

# Frame every N seconds
ffmpeg -y -i input.mp4 -vf fps=1/5 frames/frame_%04d.jpg   # every 5 sec

# All frames (use sparingly on long videos)
ffmpeg -y -i input.mp4 frames/frame_%04d.png

Extract / Trim Clip

# Clip from start time, duration
ffmpeg -y -ss 00:00:30 -i input.mp4 -t 00:00:15 -c copy clip.mp4

# Clip from start to end time
ffmpeg -y -ss 00:01:00 -to 00:02:30 -i input.mp4 -c copy clip.mp4

# Re-encode for clean cut (slower but frame-accurate)
ffmpeg -y -i input.mp4 -ss 00:00:30 -t 00:00:15 clip.mp4

Extract Audio

# Extract as MP3
ffmpeg -y -i input.mp4 -vn -acodec mp3 -q:a 2 audio.mp3

# Extract as AAC (smaller)
ffmpeg -y -i input.mp4 -vn -acodec aac -b:a 192k audio.aac

# Extract as WAV (lossless)
ffmpeg -y -i input.mp4 -vn audio.wav

Format Conversion

# To MP4 (H.264 + AAC, web-compatible)
ffmpeg -y -i input.mov -c:v libx264 -c:a aac -crf 23 output.mp4

# To WebM
ffmpeg -y -i input.mp4 -c:v libvpx-vp9 -c:a libopus output.webm

# To GIF
ffmpeg -y -i input.mp4 -vf "fps=10,scale=640:-1" output.gif

# Compress (reduce size)
ffmpeg -y -i input.mp4 -vcodec libx264 -crf 28 compressed.mp4

Create Thumbnail

# At specific timestamp
ffmpeg -y -i input.mp4 -ss 00:00:05 -vframes 1 -vf scale=640:-1 thumb.jpg

# Best frame (scene detection)
ffmpeg -y -i input.mp4 -vf "thumbnail,scale=640:-1" -frames:v 1 thumb.jpg

Subtitles

# Extract embedded subtitles
ffmpeg -y -i input.mkv -map 0:s:0 subtitles.srt

# Burn subtitles into video
ffmpeg -y -i input.mp4 -vf subtitles=subtitles.srt output_with_subs.mp4

Usage Examples

"Extract a frame every 10 seconds from lecture.mp4"

mkdir -p frames
ffmpeg -y -i lecture.mp4 -vf fps=1/10 frames/frame_%04d.jpg
echo "Frames saved to ./frames/"

"Cut from 2:30 to 5:00 in video.mp4"

ffmpeg -y -ss 00:02:30 -to 00:05:00 -i video.mp4 -c copy clip_2m30s_to_5m.mp4

"Get the audio from interview.mp4 as MP3"

ffmpeg -y -i interview.mp4 -vn -acodec mp3 -q:a 2 interview_audio.mp3

"Convert recording.mov to mp4"

ffmpeg -y -i recording.mov -c:v libx264 -c:a aac -crf 23 recording.mp4

Rules

  • Check if ffmpeg is installed first: which ffmpeg
  • If not installed, show brew install ffmpeg and stop
  • Always use -y flag to avoid interactive prompts
  • Use -c copy for lossless clip extraction when possible (much faster)
  • For large files, warn user about processing time before starting long operations
  • Default output goes in the same directory as input with a descriptive suffix
  • When extracting many frames, create a subdirectory to avoid clutter
  • Report output file path and size after completion

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.