# Video Compressor > Shrink a video to a target size (two-pass) for e-mail, WhatsApp or Discord, or by quality. 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. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://videocompressor.usefulweb.site/ (interactive tool at https://videocompressor.usefulweb.site/tool) - JSON API: POST https://videocompressor.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://videocompressor.usefulweb.site/api/v1/tool) - OpenAPI: https://videocompressor.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://videocompressor.usefulweb.site/mcp - tool `video_compressor` ## Inputs - file (file, required): Video file - MP4, MOV, MKV, WebM, AVI, MPEG-TS, WMV, FLV; max 250 MB and 20 minutes. Processed on our server in a private temporary folder that is deleted afterwards; the result can be downloaded for about 2 hours. - mode (select): Compression mode - preset (select): Size preset - targetMb (number): Custom target size - Only used with "Custom target size". 1 MB = 1,000,000 bytes. - crf (integer): CRF (quality mode) - Lower = better and larger. 23 is the x264 default; 26–30 is small with acceptable quality. - resolution (select): Resolution - audio (select): Audio ## Method - 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. ## Limits - Size limits of e-mail providers and messengers change; check the current limit of your service. Very low targets make the picture blurry.