Video Compressor
Shrink a video to a target size (two-pass) for e-mail, WhatsApp or Discord, or by quality.
Try an example: Test clip to a 0.05 MB target (two-pass) · Constant quality CRF 30
How it works
Compresses a video to a target file size with a two-pass H.264 encode: the bitrate is calculated from the size and length, minus the audio budget, and the resolution is lowered automatically when the bitrate would be too thin. Presets for e-mail (25 MB), WhatsApp (16/100 MB) and Discord (10 MB), or a constant-quality CRF mode. Reports the achieved size.
- Target size: usable bits = (target − 2 % − 20 kB container overhead) × 8. Total bitrate = usable bits ÷ duration. Audio gets 128/96/64/48/32 kbit/s, at most about 20 % of the total; the rest goes to the video. If the video would get less than 50 kbit/s, the tool tells you the smallest workable target instead.
- Resolution "automatic" picks the largest standard height (never above the source) where the video bitrate still gives at least 0.05 bits per pixel per frame — a common H.264 rule of thumb — and caps the frame rate at 30 fps when the bitrate is below 2 Mbit/s. The suggestion table shows bits per pixel for each step.
- Two-pass libx264 (preset veryfast): pass 1 analyses the video, pass 2 distributes the bitrate where it is needed, which hits the size much more precisely than one pass. maxrate/bufsize limit spikes. Quality mode is a single CRF pass.
- The output is MP4 (H.264/AAC, faststart for streaming). The achieved size is measured and compared with the target; two-pass is typically within a few percent.
Size limits of e-mail providers and messengers change; check the current limit of your service. Very low targets make the picture blurry.
Sources
- FFmpeg H.264 encoding guide (two-pass, CRF) (FFmpeg wiki)
For scripts and AI agents
- JSON API:
POST https://videocompressor.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://videocompressor.usefulweb.site/mcp· tool namevideo_compressor
Example request
curl -s -X POST https://videocompressor.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'Related tools
- Universal Video Converter – Convert video to MP4, WebM, MOV or MKV: resize, set quality and fps, or remux losslessly.
- Video Cutter & Merger – Trim video, remove a section or join clips: lossless copy or frame-exact re-encode.