You're staring at a video file that's too big for email, too heavy for a website upload, or too slow for social platforms. The fix isn't guessing at a random preset and hoping for the best. How to compress an MP4 video comes down to choosing the right codec, bitrate, resolution, and quality mode for the job, then using them in a way that protects the parts of the footage people notice.
Understanding What Actually Shrinks an MP4 File

MP4 is a container, not the compression method itself. The file gets smaller because you change what's inside it, usually by switching codec, lowering bitrate, scaling resolution, or using a smarter quality setting such as CRF. If you treat every “compress” button as the same thing, the result is unpredictable, and that's how people end up with files that barely shrink or turn into a blocky mess.
Codec does the heavy lifting
The codec is the engine. H.264 is the safest universal choice, H.265/HEVC is more efficient when compatibility allows it, and AV1 can be even smaller on modern devices. Independent compression guidance notes that H.265 can produce roughly 40 to 50% smaller files at similar quality, while AV1 can be smaller still on supported hardware and software, though encode time and compatibility become real trade-offs (xConvert MP4 compression guide).
That's why codec choice comes before tool choice. A “compress” preset that keeps the same codec and only nudges the bitrate may save very little. A codec change, especially from H.264 to H.265, usually has far more impact than beginners expect.
Bitrate, resolution, and CRF are different levers
Bitrate controls how much data each second of video gets. Lower bitrate usually means a smaller file, but if you push it too far, motion-heavy scenes fall apart first. Resolution controls pixel count, so reducing frame size can shrink files fast, but it also throws away detail permanently. Microsoft's media compression guidance for PowerPoint notes that lowering resolution and quality reduces file size, and one MP4 guide specifically recommends resizing before encoding when the original resolution isn't needed (Microsoft media compression guidance).
CRF is the quality knob. Lower CRF keeps more detail and makes a larger file, while higher CRF shrinks more aggressively and risks artifacts. That's why a one-click preset can't answer every use case. A creator exporting a webinar, a marketer preparing a social clip, and an editor hitting a hard upload cap all need different choices.
Practical rule: if the footage must look good everywhere, start by changing codec and CRF. If the file must hit a specific size, bitrate and two-pass encoding matter more.
If you want a broader creator workflow around media publishing, LunaBloom AI sits in the same practical ecosystem of export-aware content production, where output format matters as much as the edit itself.
Compressing MP4 Files with HandBrake

HandBrake is the tool I use when the job needs a practical balance of control and speed. It keeps the settings visible without forcing you into command-line work, which makes it easier to match the output to the platform instead of guessing. One independent guide recommends starting with the Fast 1080p30 preset, then switching the video codec to H.265 (x265) with Constant Quality CRF 28, and setting audio to 128 kbps for a smaller export (Compresto HandBrake guide).
A sensible workflow starts with the best source you have, then asks one question first, do you need broad playback support or the smallest file possible? That answer decides whether compatibility or compression should lead the settings. For files that need dependable playback, H.264 is still the safer choice. For controlled devices or modern platforms, H.265 usually gives more compression for the same visual quality, but older players can still struggle with it.
A workflow that doesn't waste time
Open the file, pick a preset that matches the delivery target, and avoid changing every slider at once. HandBrake works best when you treat it as a decision tool, not a magic preset picker. Keep the original resolution if the platform benefits from full detail, and only reduce frame size if the output does not need every pixel.
The trade-off is simple. CRF gives you consistent visual quality, but it does not promise a fixed file size. If the delivery brief is based on appearance, CRF is the right starting point. If the upload limit is strict, you may need to accept a little more quality loss to make the size land where it needs to.
The settings that matter most
In practice, only a few controls change the result in a meaningful way.
- Video codec: use H.264 for maximum compatibility, or H.265 when smaller output matters and playback support is acceptable.
- Quality mode: use CRF when you care about how the video looks more than the final file size.
- Audio bitrate: keep AAC at a reasonable bitrate, and trim it if the source audio is larger than the job needs.
- Resolution: keep the original size when detail matters, or lower it only when the target platform does not need the full frame.
A short preview is usually enough to catch the problems that matter. Encode a small section before you commit to the full file, especially if the video has motion, text overlays, or soft gradients. Those are the places where compression damage shows up first, and they tell you quickly whether the CRF is too aggressive or the codec choice is too heavy for the target. I use that check on client work all the time, because fixing a bad test clip is cheap and redoing a full export is not.
For teams building video into a broader publishing process, the LunaBloom AI starter app is a useful place to see how export settings fit into a larger production workflow.
Using FFmpeg for Precise Compression Control
FFmpeg is the right tool when you need the encode to behave a certain way. It gives exact control over codec choice, quality mode, bitrate, audio, and pass structure, which matters when the file has to fit a platform rule without wasting more quality than necessary. For a stable starting point, use H.264 with CRF 22 to 24, or H.265 with CRF around 28, with AAC audio in the 96 to 192 kbps range.
CRF for quality-first compression
For flexible quality control, use CRF. The core pattern is simple:
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset slow -c:a aac -b:a 128k output.mp4
That command keeps the video in H.264, aims at a solid middle-ground quality level, uses a slower preset for better compression efficiency, and trims audio to a sensible AAC bitrate. If playback support is acceptable and file size matters more, H.265 with CRF 26 to 28 is a reasonable option for MP4 compression.
The trade-off is direct. Lower CRF preserves more detail and creates a larger file. Higher CRF shrinks the file harder and can introduce visible artifacts in motion, text, or soft gradients. CRF works best when visual consistency matters more than hitting an exact MB target.
Two-pass encoding for a specific file size
When the platform sets the limit, bitrate targeting is the better fit. One practical bitrate formula is video_bitrate_kbps = ((target_size_MB × 8192) / duration_seconds) − audio_bitrate_kbps.
That is the cleanest way to work from an output budget. If you need a predictable size, calculate the bitrate first, then use two-pass encoding so the encoder can spread bits more intelligently across the full file.
A common pattern looks like this:
ffmpeg -i input.mp4 -c:v libx264 -b:v 3400k -pass 1 -an -f null /dev/null
ffmpeg -i input.mp4 -c:v libx264 -b:v 3400k -pass 2 -c:a aac -b:a 96k output.mp4
The first pass analyzes complexity. The second pass spends bits where they matter, especially in fast motion and detailed scenes. That is why two-pass encoding is the better choice when the file size has to land in a specific range rather than just get smaller.
A short test encode is still worth doing before a full export, especially on clips with motion, text overlays, or soft gradients. I use that check constantly, because the wrong bitrate choice shows up fast on a sample and costs much more to fix after a full render. For teams that want to keep compression decisions tied to the rest of the production workflow, the LunaBloom AI app fits into a standardized export process without slowing the handoff.
Alternative Tools for Quick Compression Tasks

Not every MP4 needs a full FFmpeg or HandBrake pass. Sometimes you just need a smaller file fast, on a laptop you don't control, or from a phone while you're away from the edit bay. That's where VLC, online compressors, and mobile apps enter the picture, though each one comes with a different compromise.
VLC works for basic conversion, not precision
VLC's built-in conversion is useful when you need a quick one-off export and already have it installed. It's fine for basic tasks, but it doesn't give the same fine-tuned control over CRF, bitrate targeting, or two-pass logic that you get in HandBrake or FFmpeg. Use it when convenience matters more than exact output tuning.
Online compressors are fast, but privacy and limits matter
Cloud-based compressors are attractive because there's almost no setup. Upload, wait, download. The problem is that many of them impose file size limits, resolution caps, or quality presets you can't fully inspect, and they also require you to hand over the source file. For client work, internal training content, or unreleased marketing footage, that privacy trade-off can be unacceptable.
Mobile apps are fine for emergency use
iOS and Android compression apps are best treated as field tools. They're handy for sending a clip from the phone, preparing a quick social post, or shrinking a screen recording on the fly. They're usually not the right place for final masters, because the settings are often simplified and the control surface is thin.
Bottom line: use VLC for convenience, online tools for low-stakes files, and mobile apps for on-the-go edits. Keep HandBrake or FFmpeg for anything that needs consistent quality.
For a quick visual reference on lightweight publishing workflows, the LunaBloom AI about page is worth a look, especially if your compression decisions are part of a larger content pipeline rather than a one-off export.
Recommended Settings for Social Platforms and Target Sizes
Different platforms compress your upload again, which means your first export needs enough quality headroom to survive a second pass. The safest pattern is to upload a clean source, then let the platform do its own processing without starting from a damaged file. That's why a good preset for one destination can be a bad choice for another, even when the file size looks perfect on your desktop.
A practical settings matrix
| Platform or Target | Codec | CRF | Resolution | Audio Bitrate |
|---|---|---|---|---|
| YouTube | H.264 | 22 to 23 | Original resolution when possible | AAC 128 to 192 kbps |
| H.264 | 23 | Match the platform crop and delivery needs | AAC 128 kbps | |
| TikTok | H.264 | 23 to 24 | Original or platform-friendly vertical framing | AAC 128 kbps |
| H.264 | 23 | Keep readable text and stable motion | AAC 128 kbps | |
| H.264 | 22 to 23 | Original if the frame holds up well | AAC 128 kbps | |
| Email attachment | H.265 when supported, otherwise H.264 | 26 to 28 for H.265, or 23 for H.264 | Reduce if the file still won't fit | AAC 96 to 128 kbps |
| Website hosting | H.264 for maximum compatibility, H.265 when playback support is known | 22 to 24 | Keep original if page speed allows it | AAC 128 kbps |
That table reflects the inherent trade-off, not a one-size-fits-all preset. If the platform re-encodes aggressively, the best move is often to preserve enough source quality that their compression doesn't wreck the image. If the target is a hard file-size budget, codec and CRF matter, but bitrate targeting becomes more useful, as covered earlier.
Matching settings to file-size budgets
A few practical pairings work well in practical applications:
- 10 MB target: shorten the clip, lower resolution if needed, and use a more efficient codec when playback support allows it.
- 25 MB target: use CRF first if quality matters, then move to two-pass bitrate control if the file still misses the cap.
- 50 MB target: keep the source resolution if the shot is clean, especially for talking-head or slide-based content.
- 100 MB target: you usually have room to preserve more detail, so avoid over-compressing just because the file can be smaller.
Practical rule: don't optimize for the smallest file. Optimize for the smallest file that still survives the platform's own compression.
For platform-specific exports, it helps to know whether the destination values compatibility, quality, or upload convenience most. If you're shipping assets to a team or client, LunaBloom AI contact can be a useful starting point for discussing production workflows that need consistent output formats.
Common Compression Mistakes and How to Avoid Them

Compression mistakes usually do not show up at export time. They show up later, when a client points out banding, a social upload looks soft, or a file that should have shrunk barely changes at all. The fix is to catch the failure mode before you commit to a full final render.
The four mistakes that cause most bad exports
Re-encoding an already compressed file. The result is softer edges, blocky motion, and a file that still does not feel clean. The cause is double compression. Start from the highest-quality master available, because every extra encode adds more loss.
Setting bitrate too low for motion-heavy scenes. The result is blockiness or banding, especially during movement. Fast scenes need more bits than a talking head shot. Raise bitrate, lower resolution, or switch to a more efficient codec before the export breaks down.
Ignoring audio bitrate. The result is a file that is larger than it needs to be without any audible gain. Keep the audio setting in line with the content. AAC at a sensible bitrate is usually enough for exports that do not need high-fidelity sound.
Picking the wrong codec for the playback environment. The result is a clean file that does not play well on the target system. Compatibility matters as much as size and quality. Use H.264 when broad playback support matters, then move to H.265 or AV1 only when the destination can handle them.
A short pre-flight checklist
Before any serious compression job, run this list:
- Check the source quality and avoid compressing from an already mangled file.
- Confirm the playback target so you do not choose a codec the environment cannot handle.
- Test a short segment with motion and text, not just a static intro frame.
- Review audio settings so you are not wasting bits on unnecessary sound quality.
- Verify the final export before sending it to a client or platform.
That checklist takes less time than fixing one bad render after delivery. It is the difference between a clean workflow and a guessing game.




