Compress video
Shrink a video by re-encoding it at a lower quality, in the browser only, like video-convert (src/tools/video-convert.ts), because mediabunny encodes through WebCodecs, which Node has no equivalent of. Always outputs MP4. Nothing is uploaded.
Runs on your device. The file is never uploaded.
Compress video re-encodes a clip at a quality preset, low by default, and returns MP4 named with a -compressed.mp4 ending. forceTranscode forces a real decode and encode even when the input already uses the output codec. There is no target size field, and re-encoding needs WebCodecs, which Node lacks, so the page is the only surface that runs it.
Questions
How much smaller will my video get?
That depends on the source, and the tool makes no promise. It re-encodes through mediabunny with the quality preset you choose, and quality defaults to low because shrinking is the point. A video that was already encoded efficiently at low bitrate might not shrink much, or at all. There is no target size field and no way to ask for a specific percentage.
Will the quality drop?
Yes. This is a lossy re-encode, not a lossless repack. The tool sets forceTranscode so that a file already using the output codec is decoded and encoded again rather than copied through unchanged. That is what makes compression possible, and it also means detail is lost. Pick medium or high quality if low looks too rough.
What format do I get back?
Always MP4. The output format is fixed to mediabunny Mp4OutputFormat regardless of what you put in, so a WebM or MOV input comes back as MP4. The file is named after your input with a -compressed.mp4 ending, for example holiday.mov becomes holiday-compressed.mp4.
Why will it not run on the command line?
Because it encodes through WebCodecs, which Node does not implement. The tool is marked browser only and the CLI and MCP surfaces refuse it up front with "video-compress needs a browser (OffscreenCanvas). Use it at /video/video-compress instead." The browser page runs the same code in a Web Worker.
How big a file can it take?
There is no fixed limit in the code, but the whole video is held in browser memory while it is read, and the compressed result is built in memory too. A short clip is fine on any machine. A long recording from a phone or a camera can exhaust a tab, and a phone gives up sooner than a laptop. If a large file fails, trim it first and compress the parts.
Is anything uploaded?
No. The file never leaves your device. Compression happens in a Web Worker in the page you have open, with no server round trip and no account. You can turn your network off and it still works after the first visit.