Compress MP4 Online — Free File Size Reducer
Compress an MP4 file into a smaller MP4 using H.264 video encoding and AAC audio at configurable quality levels — all processed locally in your browser via FFmpeg.wasm with no uploads required. Ideal for reducing file size while preserving broad device compatibility, since H.264/AAC inside MP4 is universally supported across virtually every platform, browser, and media player.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MP4 file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
Because both the input and output are MP4 containers using the same codec family, this tool re-encodes the video stream using the libx264 H.264 encoder with a Constant Rate Factor (CRF) of 23 — a visually transparent quality level that significantly reduces bitrate compared to most recorded or exported MP4 files. The audio is re-encoded to AAC at 128k bitrate, which is appropriate for stereo content. Unlike a simple remux (container swap without re-encoding), compression here actively discards redundant visual data frame-by-frame to shrink file size, so the output will always be smaller than the input but cannot be perfectly restored to the original. The -movflags +faststart flag relocates the MP4 metadata (the 'moov' atom) to the beginning of the file, enabling the compressed video to begin playing before it fully downloads — essential for web streaming.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia processing engine that handles all decoding, re-encoding, and muxing operations for this MP4-to-MP4 compression. |
-i input.mp4
|
Specifies the source MP4 file to be read. FFmpeg will detect all embedded streams — video, audio, subtitles, chapters — and make them available for processing. |
-c:v libx264
|
Selects the libx264 encoder for the output video stream, producing H.264-encoded video. H.264 is chosen here for its universal playback compatibility across browsers, devices, and operating systems. |
-crf 23
|
Sets the Constant Rate Factor to 23, which is libx264's default quality level. This controls how aggressively the encoder compresses each frame — lower values preserve more detail and produce larger files, while higher values increase compression and reduce file size at the cost of visual quality. |
-c:a aac
|
Re-encodes the audio stream using the AAC codec, which is the standard audio format for MP4 containers and is natively supported by all major browsers and devices without additional decoders. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, which is a well-established threshold for transparent-sounding stereo audio — indistinguishable from higher bitrates for most listeners in most content types. |
-movflags +faststart
|
Relocates the MP4 moov atom (the file's index and metadata block) to the very beginning of the output file, so web players and browsers can begin streaming and rendering the video before the entire file has downloaded. |
output.mp4
|
Defines the filename of the compressed MP4 file. The .mp4 extension instructs FFmpeg to use the MP4 container format, which supports H.264 video, AAC audio, subtitles, and chapter data. |
Common Use Cases
- Shrinking a large screen recording or Zoom export before attaching it to an email or uploading it to a project management tool with file size limits
- Reducing the size of a high-bitrate MP4 exported from video editing software like DaVinci Resolve or Premiere Pro before publishing to a website or CMS
- Compressing a drone or action camera footage file (which often records at very high bitrates) to a manageable size for sharing via Google Drive or Dropbox
- Preparing an MP4 video for embedding on a web page where load time and bandwidth costs matter, while keeping the universally supported H.264/AAC format
- Reducing storage usage on a phone or laptop by batch-compressing locally recorded MP4 videos without converting to a different format
- Creating a smaller preview or review copy of a finished video production to send to clients while retaining the original high-quality master
Frequently Asked Questions
It depends entirely on the bitrate of your source file. If your input MP4 was exported from a video editor at a very high bitrate (e.g., 50 Mbps from Premiere Pro), compressing to CRF 23 could reduce the file to 10–20% of its original size with barely perceptible quality loss. If your source MP4 is already heavily compressed (e.g., a 720p video downloaded from social media), the size reduction will be modest and the quality may degrade slightly since you are re-encoding an already-lossy file. The CRF value is the single biggest lever: lower values like 18 produce larger, higher-quality files, while higher values like 28–35 produce smaller files with more visible compression artifacts.
Yes — this is a lossy re-encode, not a lossless operation. The libx264 encoder at CRF 23 analyzes each frame and discards visual information the human eye is least likely to notice, particularly in fast-moving scenes and areas of high spatial complexity. Each generation of re-encoding adds compounding quality loss, so you should always compress from the highest-quality source available rather than re-compressing an already-compressed MP4. If you need mathematically lossless compression, you would need to use CRF 0, though the resulting file will be very large and not practical for sharing.
Subtitle tracks, chapter markers, and multiple audio tracks embedded in the source MP4 can be preserved, but the default FFmpeg command shown here re-encodes only the first video and first audio stream. To retain additional audio tracks or subtitle streams, you would need to modify the command to include flags like -map 0 to copy all streams, and specify codec handling for each. The MP4 container format natively supports subtitles (typically as mov_text), chapters, and multiple audio tracks, so the container itself is not the limiting factor.
CRF controls the trade-off between file size and visual quality in H.264 encoding. CRF 23 is the libx264 default and produces a good balance suitable for most web and sharing use cases. CRF 18 is often described as 'visually lossless' — the output looks essentially identical to the source but the file is noticeably larger. Conversely, CRF 28 or higher produces significantly smaller files but introduces visible blockiness in motion sequences and dark areas. For archival or client delivery purposes, CRF 18–20 is recommended; for maximum compression where some quality loss is acceptable, CRF 28–35 is a practical range.
To adjust video compression, change the number after -crf. For example, replace '-crf 23' with '-crf 18' for higher quality or '-crf 28' for a smaller file. To change audio quality, replace the value after -b:a — for example, '-b:a 192k' for higher-fidelity stereo audio or '-b:a 96k' for a smaller audio footprint. To process an entire folder of MP4 files in one command on desktop, you can use a shell loop such as: for f in *.mp4; do ffmpeg -i "$f" -c:v libx264 -crf 23 -c:a aac -b:a 128k -movflags +faststart "compressed_$f"; done
H.264 (libx264) is used as the default because it has near-universal hardware and software support — every major browser, smart TV, smartphone, and media player can decode it without issues. H.265 (HEVC/libx265) typically achieves 30–50% smaller file sizes at equivalent quality, but it has inconsistent browser support (Safari supports it; Chrome and Firefox generally do not natively), requires hardware decoding on lower-end devices, and sometimes carries licensing complications. If your target platform is known to support HEVC — such as Apple devices or direct file playback — you can substitute '-c:v libx265' and '-crf 28' (HEVC CRF scales differently) in the FFmpeg command for better compression at the cost of broader compatibility.
Technical Notes
This compression workflow uses libx264 in its variable bitrate Constant Rate Factor (CRF) mode, which allocates more bits to complex scenes and fewer to simple ones — producing more consistent perceived quality than a fixed bitrate (-b:v) approach. The default CRF 23 targets a visually acceptable output for general use; x264 preset defaults to 'medium', balancing encoding speed against compression efficiency. For desktop use, adding '-preset slow' or '-preset veryslow' to the command can further reduce file size at the same CRF value by allowing the encoder more time to find efficient compression patterns. The AAC audio codec used is the native FFmpeg AAC encoder (not libfdk_aac), which is high quality at 128k and above for stereo content. Metadata such as title, creation date, and camera information embedded in the MP4's moov atom is generally preserved through the re-encode. The -movflags +faststart flag is particularly important for web delivery: it runs a second pass to move the moov atom before the media data, so browsers can begin rendering the video during download rather than waiting for the entire file. Note that MP4 does not support transparency (alpha channel video); if your source contains an alpha channel encoded via a different container, it will not be preserved in the output.