video-compress-to-size
Skill210 starsChanged 2 days agoMITView on GitHub
Compresses a single video file to stay under a user-specified max file size using FFmpeg. Prefers GPU encoders (NVENC / AMF / QSV) with VBR bitrate targeting; falls back to CPU two-pass H.264/HEVC. Use when the user wants to compress video, reduce video file size, shrink MP4/MKV/MOV under N MB, GPU encode, NVENC compress, or re-encode a clip to a size limit.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- godot-fun/godot-agentword for word, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 1
- godot-fun/godot-agent★ 210100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- ai-text-to-speechSkill
- audio-denoiseSkill
- audio-fadeSkill
- audio-loudness-normalizationSkill
- audio-sample-rate-standardizeSkill
- audio-splitSkill
- audio-to-oggSkill
- audio-to-textSkill
- audio-to-wavSkill
- audio-trimSkill
- audio-volume-adjustSkill
- file-naming-normalizationSkill
- git-commit-messageSkill
- image-inpaint-regionSkill
- image-region-remove-key-color-appSkill
- image-remove-backgroundSkill
- image-remove-white-backgroundSkill
- image-resizeSkill
- image-sprite-sheet-splitSkill
- image-to-pngSkill
- image-to-textSkill
- image-trimSkill
- storyboard-av-mixSkill
- storyboard-shot-to-htmlSkill
- storyboardSkill
- storyboard-ttsSkill
- video-4k-normalizationSkill
- video-bgmSkill
- video-cutSkill
- video-merge-gpuSkill
- video-mergeSkill
- video-publishSkill
- video-remove-audioSkill
- video-to-4kSkill
- video-to-60fpsSkill
- video-to-mp4Skill
- video-to-ogvSkill
- video-to-wavSkill
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
- Very specific: line 14
When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.
- Very specific: line 16
Run compress.py through .dependency/python/python.exe.
- Distinctive: line 18
Use the bundled script — do not hand-write equivalent FFmpeg commands.
- Very specific: line 83
Use the bundled script, not hand-written ffmpeg commands.
- Very specific: line 84
Always pass --max-size from the user (ask if missing).
- Distinctive: line 86
Do not downscale or change fps unless the user asks.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Video Compress To Size
Re-encode a supported video so the output is at or under a given max file size.
Default: probe and use a GPU encoder when available (NVIDIA NVENC → AMD AMF → Intel QSV), single-pass VBR. If no GPU works, fall back to CPU two-pass (libx264 / libx265).
Rules
When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.
- Run
compress.pythrough.dependency/python/python.exe. Never use hostpython/ffmpeg. - Never overwrite sources. Outputs go under
video-compress-to-size/. - Use the bundled script — do not hand-write equivalent FFmpeg commands.
- One file per run — pass
--videowith a single file; repeat for each clip in a batch.
Quick Start
.dependency/python/python .ai/video-compress-to-size/compress.py --video path/to/clip.mp4 --max-size 50MBBare numbers mean MB (--max-size 50 ≡ 50MB):
.dependency/python/python .ai/video-compress-to-size/compress.py --video assets/intro.mp4 --max-size 50Example:
assets/video/intro.mp4
→ assets/video/video-compress-to-size/intro.mp4Force CPU (slow, more precise two-pass):
.dependency/python/python .ai/video-compress-to-size/compress.py --video clip.mp4 --max-size 50MB --cpuSize Syntax
| Input | Meaning |
50 / 50MB / 50M | 50 mebibytes (1024² bytes) |
500KB / 500K | 500 kibibytes |
1GB / 1G | 1 gibibyte |
52428800B | exact bytes |
--max-size is required.
Format Defaults
| Setting | Default | Notes |
| Encoder | GPU first | h264_nvenc → h264_amf → h264_qsv → libx264 |
| HEVC | --hevc | Same order with hevc_* / libx265 |
| Container | .mp4 | Always MP4 |
| Audio | AAC 128k | Lowered automatically on tiny budgets |
| Preset | medium | Mapped (e.g. NVENC p4); override with --preset |
| Already under limit | Skipped | [skip] … (already under limit) |
| Safety margin | GPU ~90% / CPU ~92% | Headroom for mux / VBR overshoot |
Common Flags
--video · --max-size · -o / --output · --audio-bitrate · --preset · --hevc · --cpu
Custom output path:
.dependency/python/python .ai/video-compress-to-size/compress.py --video clip.mp4 --max-size 50MB -o out/clip.mp4Never overwrite source files. Input must be a single video file (--video), not a directory. Supported inputs: .mp4, .mkv, .mov, .avi, .webm, .wmv, .flv, .m4v, .mpeg, .mpg, .ts, .mts, .m2ts, .3gp, .ogv.
Agent Notes
- Use the bundled script, not hand-written
ffmpegcommands. - Always pass
--max-sizefrom the user (ask if missing). Prefer their unit wording; bare numbers are MB. - Prefer GPU — do not pass
--cpuunless the user asks or GPU encode fails. - Do not downscale or change fps unless the user asks.
- Sources already ≤ max size are skipped.
- Tell the user where
video-compress-to-size/files are; they swap assets manually when ready. - Missing Python/FFmpeg → populate
.dependency/per dependency-manager, retry same command. - Pipeline details: reference.md
Tests
From repo root:
.dependency/python/python .ai/video-compress-to-size/test_compress.pyManual CLI examples: cli/video-compress-to-size.md
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.

