Compress a file
Video Compressor offers quality-based export and a target-size mode. Quality is useful when visual detail matters more than a strict limit. Target size is useful when a destination imposes a file-size budget.
- Choose a video and confirm its duration, dimensions and source size.
- Choose a container, commonly MP4 for broad playback compatibility or WebM for a compatible destination.
- Select quality mode and a quality level, or target-size mode and the desired size in MB.
- Lower the resolution if a small budget must cover a long video. Keep or remove audio according to the task.
- Sign in, export and compare the finished file. Check motion, text and sound before sharing.
Changing only the container or copying the original encoding is not compression. An already efficiently encoded file can become larger after re-encoding.
The target-size calculation
The shared export model treats 1 MB in this setting as 1,048,576 bytes, reserves 6% for overhead, divides the remaining bits by source duration and subtracts 128,000 bits per second when audio is retained.
video_bitrate = floor(target_MB * 1048576 * 8 * 0.94 / duration_s)
- (keep_audio ? 128000 : 0)A 10 MB budget for 60 seconds with audio yields 1,186,215 bits per second for video. The same budget without audio yields 1,314,215 bits per second. The model rejects budgets that leave less than 50,000 video bits per second, asking for a larger target or a shorter clip.
This is a single-pass estimate, not a hard byte-size guarantee. Container overhead, codec behavior, scene complexity and copied audio can change the final size. For a strict external limit, allow extra margin and verify the downloaded file.
Native and WebAssembly implementations
The WebCodecs route passes the computed bitrate to a native encoder through Mediabunny, transforms frames to the selected even-sized resolution and muxes a new file. Browser configuration checks determine whether this route can produce the required video and audio.
The FFmpeg route sets the video bitrate, maximum rate and a buffer of twice that bitrate. MP4-family output uses the H.264 encoder in the WebAssembly build; WebM uses VP8. Quality-based FFmpeg output uses codec-specific quality controls instead of treating the target-size calculation as a quality score.
When the audio codec already fits the native destination and no precise trim is requested, the native route may preserve the existing audio packets. A copied audio track can differ from the 128 kbps budget assumption, which is another reason to check the final size.
Resolution and detail
The source resolution option retains the picture size with even codec-compatible dimensions. Other options cap the height and preserve aspect ratio without enlarging a smaller video. Lowering resolution reduces the amount of detail the encoder must represent at a fixed bitrate.
Screen recordings with small text may benefit from a larger resolution and budget; rapidly changing footage may require more bits than a static shot. A lower frame rate can reduce temporal detail, so inspect fast movement in the output.
What the performance measurements mean
In our same-input synthetic-video comparison, a 12-second 640 by 360 VP8 export had median times of 0.7380 seconds through WebCodecs and 3.0565 seconds through single-threaded FFmpeg WebAssembly. That result is limited to the recorded test environment, excludes network downloads and does not establish equal visual quality or a mobile speed guarantee.
The download uses a new local result; the source is unchanged. The result summary reports the actual size and whether it is smaller or larger. Cancelling terminates the engine and allows another attempt with revised settings.