compress-video
Skill2 starsChanged 3 months agoApache-2.0View on GitHub
Compress and re-encode a video file to a smaller MP4 (H.264 + AAC) using ffmpeg. Use when the user asks to compress, shrink, reduce, downsize, or "make smaller" a video; convert .mov / .mkv / .webm / .avi to .mp4; prepare an iOS Simulator, Android Emulator, or React Native screen recording for a GitHub PR (10 MB upload limit); or share a video via Signal, Slack, or email. The user may give an explicit file path or gesture at a location — e.g. "the latest video in Downloads", "my most recent screen recording", "the latest .mov in ~/Movies".
- Installs packages
In this repository16 other files it gives its agents.
- aikido-jiraSkill
- adr-authoringSkill
- architecture-diagrammingSkill
- raid-loggingSkill
- rfc-authoringSkill
- fixing-accessibilitySkill
- frontend-designSkill
- grill-meSkill
- handoffSkill
- improve-animationsSkill
- improveSkill
- logical-commitsSkill
- nutshellSkill
- pr-dailySkill
- supply-chain-checkSkill
- the-foolSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Verify the file exists. Capture its size (stat/ls -l) before encoding so you can report the delta.
- Distinctive: line 28
Run, quoting both paths so spaces and special characters survive:
- Distinctive: line 34
After encoding finishes, report:
- Very specific: line 43
GitHub PR attachments cap at 10 MB: If the compressed output is still over that — typical for long iOS Simulator recordings — bump -crf …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Compress Video
Re-encodes a video file with ffmpeg using defaults tuned for sharing: H.264 video at CRF 28, AAC audio at 128 kbps, and +faststart so the file plays before fully downloading.
Prerequisites
ffmpeg must be on PATH. If ffmpeg -version fails, stop and tell the user to install it (e.g. brew install ffmpeg on macOS, apt install ffmpeg on Debian/Ubuntu).
Steps
- Resolve the input path from the user's message:
- Explicit path — use it directly.
Location reference (e.g. "the latest video in Downloads", "my most recent recording", "the latest .mov in ~/Movies") — find the most recently modified video file in that directory and confirm with the user before encoding:
find <dir> -maxdepth 1 -type f \( -iname '*.mov' -o -iname '*.mp4' -o -iname '*.mkv' -o -iname '*.webm' -o -iname '*.avi' \) -print0 | xargs -0 ls -t | head -1One-liner confirmation: "Found
clip.mov, ~42 MB, modified 5 min ago — compress?"- Still ambiguous — ask.
- Verify the file exists. Capture its size (
stat/ls -l) before encoding so you can report the delta. - Compute the output path: same directory and basename as the input, suffixed with
-compressed.mp4. Example:/Users/me/clip.mov→/Users/me/clip-compressed.mp4. Run, quoting both paths so spaces and special characters survive:
ffmpeg -i "<input>" -c:v libx264 -preset slow -crf 28 -c:a aac -b:a 128k -movflags +faststart "<output>"- After encoding finishes, report:
- Original size
- Compressed size
- Compression ratio (e.g. "62% smaller" or "2.6× reduction")
- Output path
Tuning
-crf 28is the quality dial. Lower = better quality + bigger file.18–23is visually lossless;28is the sharing sweet spot. Drop to23–25if the user complains about quality.- GitHub PR attachments cap at 10 MB. If the compressed output is still over that — typical for long iOS Simulator recordings — bump
-crftoward30–32and re-encode, or switch to two-pass with an explicit target bitrate (see below). Always re-check the output size before reporting back. -preset slowtrades encode time for compression efficiency. Swap tomediumorfasterif the user needs a quick turnaround and tolerates a larger file.- For a target file size (e.g. "under 100 MB"), switch to two-pass encoding: compute
target_video_bitrate = (target_bytes * 8 / duration_seconds) − audio_bitrate, then run with-b:v <bitrate> -pass 1and-b:v <bitrate> -pass 2.
Skip this skill when
- The user wants to trim, clip, or splice the video — that is different ffmpeg flags (
-ss,-to). - The output should be a non-MP4 format (WebM, GIF, animated WebP) — this skill is MP4-only.
- The user wants to inspect metadata or codec info — use
ffprobedirectly instead. - The user wants to extract audio or strip audio — different flag set.
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
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.

