compress-video
Installation
SKILL.md
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 -1
-