compress
Shrink a video to a target file size, platform preset, or quality level; cap resolution and optionally preview ffmpeg commands before running.
Instructions
Make a video smaller. Three ways to say how:
target_mb: aim for a file size in MB (MiB). Uses a two-pass encode with bitrate maths (video bitrate = target size / duration - audio, with a 5% safety margin) and lowers the resolution automatically when the bitrate would be too low to look decent. The result reports whether the target was met; errors if the target is impossibly small.
preset: discord-10mb, discord-50mb, whatsapp (16 MB, 720p max), email-25mb (aims at 18 MB because attachments grow ~37% when mailed), or web (quality-based, 1080p max).
neither: a quality-based (CRF) re-encode controlled by quality low|medium|high.
max_height: never exceed this height in pixels. output ending in .webm uses VP9/Opus, otherwise H.264/AAC (default output: name.compressed.mp4 next to the input). overwrite: replace an existing output. dry_run: return the ffmpeg commands (both passes) without running them. timeout_s: stop after this many seconds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | ||
| output | No | ||
| preset | No | ||
| dry_run | No | ||
| quality | No | medium | |
| overwrite | No | ||
| target_mb | No | ||
| timeout_s | No | ||
| max_height | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |