API & MCP
Everything a person can do on Video Compressor, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://videocompressor.usefulweb.site/api/v1/calculate– run Video CompressorGET https://videocompressor.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Video Compressor
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.
| Field | Type | Default | Description |
|---|---|---|---|
file (required) | file | — | Video file. MP4, MOV, MKV, WebM, AVI, MPEG-TS, WMV, FLV; max 250 MB and 20 minutes. |
mode | select (size, quality) | "size" | Compression mode |
preset | select (custom, email-25, whatsapp-16, whatsapp-100, discord-10) | "email-25" | Size preset |
targetMb | number | 25 | Custom target size. Only used with "Custom target size". 1 MB = 1,000,000 bytes. |
crf | integer | 26 | CRF (quality mode). Lower = better and larger. 23 is the x264 default; 26–30 is small with acceptable quality. |
resolution | select (auto, keep, 1080, 720, 540, 480, 360) | "auto" | Resolution |
audio | select (auto, remove) | "auto" | Audio |
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://videocompressor.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
video_compressor - Local stdio connector:
node src/mcp-stdio.ts --tool=video-compressor
{
"mcpServers": {
"video-compressor": { "type": "http", "url": "https://videocompressor.usefulweb.site/mcp" }
}
}