Compress Video for Web
Reduce video file size while preserving a crisp, web-ready image. Run the preset directly on this page or call the same agent-ready endpoint from your product.
Prefer the shell? Compress a video with FFmpeg, the verified FFmpeg command for this edit.
See what the tool changes.
A real example: the after side is the unedited output of a KinoPipe job. Run the live form above to generate the same result from your own media.
Demo footage: public-domain timelapses (Bureau of Land Management, Oregon · NASA SVS). Processed by the same pipeline the API and MCP tools call.
Useful defaults, typed options.
The tool slug stays stable while your agent supplies named media inputs and a narrow set of documented options.
- Faster page loads
- Lower storage and transfer costs
- Predictable MP4 output
- 01Inspect the source codec
- 02Encode with H.264
- 03Optimize bitrate and CRF
- 04Move metadata for fast start
POST /api/v1/tools/compress-videoThe command this runs
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 160k -movflags +faststart output.mp4- -crf 23
- The quality target. Lower means better and bigger, and every step of about 6 halves or doubles the file. 23 is the x264 default and what quality: "balanced" sends.
- -preset medium
- How long the encoder is allowed to think. A slower preset finds a smaller file at the same CRF. It does not make the picture better, it makes the same picture cheaper to store.
- -c:a aac -b:a 160k
- Audio is re-encoded rather than copied, so the output plays everywhere without a container surprise.
- -movflags +faststart
- Moves the index to the front of the file so a browser can start playing before the download finishes. Every MP4 we write gets this, whether you ask or not.
What it costs and how long it takes
Median wall clock on 60-second fixtures, warm workers, measured 2026-08-25.
| Hardware | $/hour | fast | balanced | 4K to 1080p |
|---|---|---|---|---|
| CPU, 4 vCPU / 8 GB | 0.168 | 13.5 s | 21.9 s | 28.5 s |
| CPU, 8 vCPU / 16 GB | 0.336 | 10.0 s | 16.2 s | 20.3 s |
| RTX A4000, 16 GB | 0.576 | 8.2 s | 9.3 s | 11.0 s |
| A40, 48 GB | 1.224 | 8.2 s | 11.5 s | 12.2 s |
The A40 costs more than twice the A4000 and finished no sooner on any of the three, which is why the pool runs A4000s. H.264 encoding stops scaling with the card long before the card runs out of room.
The three quality options, and what they actually send
fast becomes -preset veryfast -crf 27. balanced, the default, becomes -preset medium -crf 23. quality becomes -preset slow -crf 20. That is the whole mapping; there is nothing else behind the words.
Most people should leave it on balanced. Reach for fast when the output is a preview nobody keeps, and for quality when the file is going to be re-encoded again downstream and you want the generation loss to start from a better place.
What this will not do
It will not hit a target file size. CRF is a quality target, so the size falls out of the source rather than out of your request. If you need "under 8 MB for Discord", that is a two-pass encode against a computed bitrate, and we do not expose one yet.
It will not rescue an already-compressed file. Feeding a CRF 23 file back through CRF 23 mostly re-encodes the compression artifacts and hands you a slightly worse video of nearly the same size.
It will not resize on its own. Pass width or height and you get both in a single decode and encode instead of two round trips.
Doing it yourself
The command at the top is the whole job, and if you already have FFmpeg on the machine that runs your code, use it. What you are paying for here is that an agent can call this without a shell, that a bad value comes back as a typed error instead of a crash halfway through an encode, and that the encode happens on a worker rather than on the box serving your users.
Know the boundaries before you run.
About compress video
Related media tools
Optimize Video for Web
Create a fast-start, browser-compatible video tuned for web delivery.
ExploreResize Video for Social Media
Create vertical, square and landscape variants from one source video.
ExploreConvert Video to MP4
Convert MOV, WebM, AVI and other inputs into a compatible MP4 output.
Explore