[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
Quick Summary
Goal: Process multimedia files using FFmpeg for video/audio encoding, conversion, streaming, and filtering.
Workflow:
- Identify -- Match input to correct FFmpeg operation (convert, trim, merge, compress)
- Execute -- Run FFmpeg command with appropriate codec and quality settings
- Verify -- Check output file integrity and quality
Key Rules:
- Use tool selection table to pick correct FFmpeg operation
- Prefer hardware-accelerated encoding when available
- Always verify output file exists and is playable
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Media Processing Skill
Process video, audio, and images using FFmpeg, ImageMagick, and RMBG CLI tools.
Tool Selection
| Task |
Tool |
Reason |
| Video encoding/conversion |
FFmpeg |
Native codec support, streaming |
| Audio extraction/conversion |
FFmpeg |
Direct stream manipulation |
| Image resize/effects |
ImageMagick |
Optimized for still images |
| Background removal |
RMBG |
AI-powered, local processing |
| Batch images |
ImageMagick |
mogrify for in-place edits |
| Video thumbnails |
FFmpeg |
Frame extraction built-in |
| GIF creation |
FFmpeg/ImageMagick |
FFmpeg for video, ImageMagick for images |
Installation
# macOS
brew install ffmpeg imagemagick
npm install -g rmbg-cli
# Ubuntu/Debian
sudo apt-get install ffmpeg imagemagick
npm install -g rmbg-cli
# Verify
ffmpeg -version && magick -version && rmbg --version
Essential Commands
# Video: Convert/re-encode
ffmpeg -i input.mkv -c copy output.mp4
ffmpeg -i input.avi -c:v libx264 -crf 22 -c:a aac output.mp4
# Video: Extract audio
ffmpeg -i video.mp4 -vn -c:a copy audio.m4a
# Image: Convert/resize
magick input.png output.jpg
magick input.jpg -resize 800x600 output.jpg
# Image: Batch resize
mogrify -resize 800x -quality 85 *.jpg
# Background removal
rmbg input.jpg # Basic (modnet)
rmbg input.jpg -m briaai -o output.png # High quality
rmbg input.jpg -m u2netp -o output.png # Fast
Key Parameters
FFmpeg:
-c:v libx264 - H.264 codec
-crf 22 - Quality (0-51, lower=better)
-preset slow - Speed/compression balance
-c:a aac - Audio codec
ImageMagick:
800x600 - Fit within (maintains aspect)
800x600^ - Fill (may crop)
-quality 85 - JPEG quality
-strip - Remove metadata
RMBG:
-m briaai - High quality model
-m u2netp - Fast model
-r 4096 - Max resolution
References
Detailed guides in references/:
ffmpeg-encoding.md - Codecs, quality, hardware acceleration
ffmpeg-streaming.md - HLS/DASH, live streaming
ffmpeg-filters.md - Filters, complex filtergraphs
imagemagick-editing.md - Effects, transformations
imagemagick-batch.md - Batch processing, parallel ops
rmbg-background-removal.md - AI models, CLI usage
common-workflows.md - Video optimization, responsive images, GIF creation
troubleshooting.md - Error fixes, performance tips
format-compatibility.md - Format support, codec recommendations
IMPORTANT Task Planning Notes (MUST FOLLOW)
- Always plan and break work into many small todo tasks
- Always add a final review todo task to verify work quality and identify fixes/enhancements
1---2name: media-processing-33description: [AI & Tools] Use when processing multimedia files with FFmpeg (video/audio encoding, conversion, streaming), ImageMagick (image manipulation, batch processing), or RMBG (AI background removal). Covers format conversion, resizing, filtering, thumbnails, and media pipelines.4license: MIT5---6
7> **[IMPORTANT]** Use `TaskCreate` to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
8
9## Quick Summary
10
11**Goal:** Process multimedia files using FFmpeg for video/audio encoding, conversion, streaming, and filtering.
12
13**Workflow:**
14
151. **Identify** -- Match input to correct FFmpeg operation (convert, trim, merge, compress)
162. **Execute** -- Run FFmpeg command with appropriate codec and quality settings
173. **Verify** -- Check output file integrity and quality
18
19**Key Rules:**
20
21- Use tool selection table to pick correct FFmpeg operation
22- Prefer hardware-accelerated encoding when available
23- Always verify output file exists and is playable
24
25**Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).**
26
27# Media Processing Skill
28
29Process video, audio, and images using FFmpeg, ImageMagick, and RMBG CLI tools.
30
31## Tool Selection
32
33| Task | Tool | Reason |
34| --------------------------- | ------------------ | ---------------------------------------- |
35| Video encoding/conversion | FFmpeg | Native codec support, streaming |
36| Audio extraction/conversion | FFmpeg | Direct stream manipulation |
37| Image resize/effects | ImageMagick | Optimized for still images |
38| Background removal | RMBG | AI-powered, local processing |
39| Batch images | ImageMagick | mogrify for in-place edits |
40| Video thumbnails | FFmpeg | Frame extraction built-in |
41| GIF creation | FFmpeg/ImageMagick | FFmpeg for video, ImageMagick for images |
42
43## Installation
44
45```bash
46# macOS
47brew install ffmpeg imagemagick
48npm install -g rmbg-cli
49
50# Ubuntu/Debian
51sudo apt-get install ffmpeg imagemagick
52npm install -g rmbg-cli
53
54# Verify
55ffmpeg -version && magick -version && rmbg --version
56```
57
58## Essential Commands
59
60```bash
61# Video: Convert/re-encode
62ffmpeg -i input.mkv -c copy output.mp4
63ffmpeg -i input.avi -c:v libx264 -crf 22 -c:a aac output.mp4
64
65# Video: Extract audio
66ffmpeg -i video.mp4 -vn -c:a copy audio.m4a
67
68# Image: Convert/resize
69magick input.png output.jpg
70magick input.jpg -resize 800x600 output.jpg
71
72# Image: Batch resize
73mogrify -resize 800x -quality 85 *.jpg
74
75# Background removal
76rmbg input.jpg # Basic (modnet)
77rmbg input.jpg -m briaai -o output.png # High quality
78rmbg input.jpg -m u2netp -o output.png # Fast
79```
80
81## Key Parameters
82
83**FFmpeg:**
84
85- `-c:v libx264` - H.264 codec
86- `-crf 22` - Quality (0-51, lower=better)
87- `-preset slow` - Speed/compression balance
88- `-c:a aac` - Audio codec
89
90**ImageMagick:**
91
92- `800x600` - Fit within (maintains aspect)
93- `800x600^` - Fill (may crop)
94- `-quality 85` - JPEG quality
95- `-strip` - Remove metadata
96
97**RMBG:**
98
99- `-m briaai` - High quality model
100- `-m u2netp` - Fast model
101- `-r 4096` - Max resolution
102
103## References
104
105Detailed guides in `references/`:
106
107- `ffmpeg-encoding.md` - Codecs, quality, hardware acceleration
108- `ffmpeg-streaming.md` - HLS/DASH, live streaming
109- `ffmpeg-filters.md` - Filters, complex filtergraphs
110- `imagemagick-editing.md` - Effects, transformations
111- `imagemagick-batch.md` - Batch processing, parallel ops
112- `rmbg-background-removal.md` - AI models, CLI usage
113- `common-workflows.md` - Video optimization, responsive images, GIF creation
114- `troubleshooting.md` - Error fixes, performance tips
115- `format-compatibility.md` - Format support, codec recommendations
116
117---
118
119**IMPORTANT Task Planning Notes (MUST FOLLOW)**
120
121- Always plan and break work into many small todo tasks
122- Always add a final review todo task to verify work quality and identify fixes/enhancements