guide · updated 2026-10-18

how to compress a video to under 4 mb.

File size is bitrate multiplied by duration. To land under 4 MB, divide the budget by the clip length to get a bitrate, encode at that bitrate, and leave a margin because encoders overshoot. If the bitrate that comes out is too low to look good, shorten the clip or lower the resolution until it is not.

Start from the budget, not the settings

4 MB here means 4 MiB, which is 4,194,304 bytes or 33,554,432 bits. Spread over a 30 second clip that is about 1,118 kbps for everything in the file. Keep a 96 kbps audio track and 1,022 kbps is left for the picture.

bits     = 4,194,304 x 8 = 33,554,432
total    = 33,554,432 / 30s / 1000 = 1118 kbps
video    = 1118 - 96 audio = 1022 kbps

That number is a ceiling, not a target. Encoders hit an average bitrate, not an exact one, and the container adds headers and an index on top of the media. Aim lower.

Leave a margin

Basketweaver aims at 94% of the limit and sets aside 48 KiB for the container before it divides by duration. For the same 30 second clip with no audio that gives 1,038 kbps of video. If an encode still comes out too large, it measures the overshoot and tries again at a proportionally lower bitrate, up to two more times.

Doing it by hand, a 5 to 10 percent margin is a reasonable starting point. If the first file is over, scale the bitrate by how far over it is and encode again.

What to cut, in order

  • Length. Every second you trim gives its bits to the seconds you keep. It is the only cut with no quality cost.
  • Audio. A 96 kbps track is almost a tenth of the budget on a 30 second clip and more than half of it on a three minute one. Drop it if the clip works silent.
  • Resolution. Fewer pixels per frame means more bits for each one. 480p at a healthy bitrate looks better than 720p starved.
  • Frame rate. 60 fps footage dropped to 30 fps halves the frames the encoder has to pay for.

Raising a quality setting is not on the list. With a fixed size target the bitrate is already set by the maths above; these cuts change how far it has to stretch.

Doing it with ffmpeg

Two-pass encoding lets the encoder read the whole clip first, then spend bits where the motion is. It lands closer to the target than a single pass. This trims to 30 seconds starting at 0:05, scales to 480p, drops audio and encodes VP9 at 1000 kbps:

ffmpeg -ss 5 -t 30 -i input.mp4 -vf scale=-2:480 -c:v libvpx-vp9 -b:v 1000k \
  -pass 1 -an -f null /dev/null
ffmpeg -ss 5 -t 30 -i input.mp4 -vf scale=-2:480 -c:v libvpx-vp9 -b:v 1000k \
  -pass 2 -an output.webm

On Windows, replace /dev/null with NUL. To keep sound, swap -an for -c:a libopus -b:a 64k and take 64 kbps off the video bitrate. scale=-2:480 keeps the aspect ratio and rounds the width to an even number, which the encoder requires.

Or skip the maths

The Basketweaver converter does all of the above in your browser: it reads the clip length, picks the bitrate and resolution, encodes, and re-encodes if the file overshoots. Nothing is uploaded for local files.

Open the converter to turn any clip into a WebM under 4 MB, or check the upload limit for your platform.