---
name: ffmpeg-ops
description: "ffmpeg audio/video processing — transcode, extract, clip, merge, convert, analyze media files. Use when working with audio, video, or image sequences."
allowed-tools:
  - Bash
  - Read
  - Grep
---

# ffmpeg Operations

## Purpose
Process audio and video files — transcode formats, extract audio tracks, clip segments, merge files, generate thumbnails, analyze codecs.

## When to Use
- User says: "convert video", "extract audio", "clip", "transcode", "merge videos", "thumbnail"
- File pattern: `*.mp4`, `*.mkv`, `*.mov`, `*.mp3`, `*.wav`, `*.m4a`, `*.flac`

## Common Operations
- Transcode: `ffmpeg -i input.mov -c:v libx264 -crf 23 output.mp4`
- Extract audio: `ffmpeg -i video.mp4 -vn -acodec copy audio.m4a`
- Clip segment: `ffmpeg -i input.mp4 -ss 00:01:30 -to 00:02:45 -c copy clip.mp4`
- Merge: `ffmpeg -f concat -safe 0 -i list.txt -c copy merged.mp4`
- Thumbnail: `ffmpeg -i video.mp4 -ss 00:00:05 -frames:v 1 thumb.jpg`
- Probe: `ffprobe -v quiet -print_format json -show_format -show_streams input.mp4`
- Audio normalize: `ffmpeg -i input.mp3 -af loudnorm output.mp3`

## Constraints
- Always probe input file before processing
- Use `-c copy` when format change is not needed (no re-encoding)
- Verify output file size and duration after processing
