Compress Video to 8 MB
Choose or drop a video. You download a file smaller than 8 MB: MP4, or WebM in a browser that cannot encode MP4. The browser encodes the video, so no file is uploaded.
Full page version: joellof.com/compress-video/app/?limit=8mb
Why 8 MB
Section titled “Why 8 MB”8 MB is the old free limit of Discord, before 2023. Many forums and chat apps still use 8 MB.
The limits change, so check the help page of the service. Other limits:
- Any size: type your own limit.
- 10 MB: the free limit of Discord from 2024 to August 2026.
- 20 MB: Discord.
- 25 MB: Gmail and Outlook.
- 50 MB: Discord Nitro Basic.
What it does
Section titled “What it does”- It fits the limit. The page picks the bit rate and the resolution from the length of the video, so the file is under 8 MB, not on it.
- A long video. When the whole video cannot look good in 8 MB, the page says how many seconds fit and compresses the start of the video.
- Any video that the browser reads: MP4, MOV, WebM and more. The download is
<name>-8mb.mp4, or<name>-8mb.webmin a browser that cannot encode MP4. - Keep the audio, or turn it off to give all the bits to the picture.
How it works
Section titled “How it works”-
Mediabunny reads the video and its duration, size and audio in the browser.
-
The page computes the bit rates that fit the limit. It keeps 5% for the container, gives the audio 128 kbit/s (64 kbit/s for a long video) and gives the rest to the video. It picks the largest resolution that the video bit rate can carry: 1080p, 720p, 480p or 360p, and never a larger one than the input.
-
The page encodes with the first encoder that the browser has:
- H.264 and AAC in MP4 with WebCodecs, on the GPU when the browser can. Mediabunny writes the MP4 file.
- VP9 and Opus in WebM with WebCodecs, when the browser cannot encode H.264. Mediabunny writes the WebM file. Discord plays WebM.
- H.264 and AAC in MP4 with FFmpeg (
libx264, in WebAssembly), when the browser has neither. The page loads FFmpeg (about 32 MB) only then. One pass, with the bit rate capped, so the file lands near the target.
When an encoder fails during the encode, the page says so and tries the next one. Only the last one shows its error.
-
When the file is still over the limit, the page encodes again at a lower bit rate. When that bit rate is too low for the picture, it goes one step smaller: mono audio at 32 kbit/s, then 240p, then 15 frames per second. When even the smallest step is over the limit, the page says how many seconds fit. A long video starts at the step that fits, so the page trims a video only when even the smallest step is too large. A step never raises the frame rate of the video.
Browsers
Section titled “Browsers”Every current browser works. Chrome, Edge and Safari encode H.264 on the GPU: a short clip takes seconds. A browser that cannot encode H.264 gets a WebM file. A browser with no video encoder of its own uses FFmpeg, which runs on one thread and can be many times slower than the video is long, so the page shows the time left. FFmpeg keeps the whole video in memory, so it takes videos up to 500 MB.
Tech Stack
Section titled “Tech Stack”| Language | TypeScript |
| UI | React |
| Platform | Browser (WebCodecs, WebAssembly) |
| Key Deps | Mediabunny (MPL 2.0), ffmpeg.wasm |
| Build | Bun |
Mediabunny reads and writes the media files. It is under the Mozilla Public License 2.0.
ffmpeg.wasm (@ffmpeg/ffmpeg, @ffmpeg/core) encodes in a browser with
no WebCodecs encoder. This server serves the FFmpeg core, so no CDN gets your files.
License of FFmpeg
Section titled “License of FFmpeg”The FFmpeg core is @ffmpeg/core 0.12.10 of ffmpeg.wasm, under the GPL 2.0 or later. Its source is in the
ffmpeg.wasm repository.
Related projects
Section titled “Related projects”- View Metadata: see the codec, the resolution and the bit rate of a video before and after.
- Convert to WAV: take the audio of a video as a WAV file.