Tutorial
Video Compression Explained: Codecs, Bitrate, and Quality
Understand how video compression works and how to get the smallest file with the best quality.
10 min read
Why Video Files Are So Large
A single frame of uncompressed 1080p video contains about 6 MB of data. At 30 frames per second, one minute of raw footage weighs roughly 10.8 GB. Even a short social media clip would be impractical to store or share without compression.
Video compression works by exploiting two types of redundancy. Spatial redundancy refers to the fact that neighbouring pixels within a single frame tend to be similar — a blue sky, for instance, is thousands of nearly identical pixels. Temporal redundancy recognises that consecutive frames are mostly the same; only the parts that move between frames need to be stored. By encoding only the differences, modern codecs can reduce that 10.8 GB minute to 100–300 MB with very little visible quality loss.
Containers vs. Codecs
A common point of confusion is the difference between a container and a codec. The container (MP4, MKV, MOV, AVI, WebM) is the file format — a wrapper that holds one or more streams of video, audio, subtitles, and metadata. The codec (H.264, H.265/HEVC, VP9, AV1) is the algorithm that compresses and decompresses the actual video data inside the container.
The same codec can live inside different containers. For example, H.264 video is commonly found in MP4, MKV, and MOV files. When choosing a format for the web, MP4 with H.264 video and AAC audio offers the broadest compatibility. For smaller files at equivalent quality, consider MP4 with H.265 or WebM with VP9.
Understanding Bitrate
Bitrate is the amount of data used per second of video, measured in kilobits per second (kbps) or megabits per second (Mbps). Higher bitrate means more data is available to represent each frame, which generally means better quality — but also larger files.
There are three common bitrate modes:
• Constant Bitrate (CBR) allocates the same data rate throughout the video. Simple to predict file size, but wastes bits on static scenes and starves complex scenes.
• Variable Bitrate (VBR) adjusts the bitrate dynamically — using less data during simple scenes and more during action-packed or visually complex sequences. This produces better quality per byte.
• Constant Rate Factor (CRF) is a quality-targeting mode used by x264 and x265. You specify a quality level (e.g., CRF 23 for H.264), and the encoder adjusts bitrate to maintain that quality throughout. CRF is the recommended approach for most offline encoding.
Popular Codecs Compared
H.264 (AVC) remains the most widely supported video codec. Virtually every device, browser, and platform can decode it. For a 1080p video, a CRF of 18–23 typically produces excellent results at roughly 4–8 Mbps.
H.265 (HEVC) achieves roughly the same visual quality at about half the bitrate of H.264. However, hardware and software support is less universal, and encoding is slower. It's ideal for archiving, local playback, and platforms that support it (Apple devices, most smart TVs).
VP9 is Google's open, royalty-free codec used heavily on YouTube. Quality and efficiency are comparable to H.265, with good browser support via WebM.
AV1 is the newest contender — open, royalty-free, and roughly 30% more efficient than H.265. Encoding is very slow, but hardware decoders are now shipping in recent devices. It's increasingly the codec of choice for streaming platforms.
Practical Tips for Smaller Video Files
• Match resolution to the delivery medium — don't export 4K if your audience will watch on a phone at 720p.
• Use two-pass encoding or CRF mode instead of CBR for the best quality-to-size ratio.
• Trim unnecessary footage before encoding — removing a few seconds of black frames at the start and end can shave megabytes.
• Choose the slowest encoding preset you can tolerate — slower presets like "slow" or "veryslow" in x264/x265 produce smaller files at the same quality.
• Strip metadata and extra audio tracks you don't need.
• For web delivery, consider serving multiple resolutions via adaptive streaming (HLS/DASH) so viewers only download the quality their connection supports.
Compress Video with MagicConverters
Upload your video to MagicConverters and our engine will analyse the content, select optimal encoding settings, and produce a smaller file while preserving visual quality. You can convert between MP4, MOV, AVI, WebM, and more — or simply compress an existing MP4 to reduce its size for sharing by email or uploading to social media.
video compressionvideo codecsbitrateh264 vs h265video file size
Related Articles
Guide
Convert Video to MP4 Online Free (No Watermark)
The complete guide to converting any video format to MP4 online — free, fast, with no watermarks, no sign-ups, and no software to install.
GuideBest Video Format for YouTube Uploads
YouTube re-encodes every upload, but your source format affects the final quality. Here's what to upload for the best results.
TrendingBest AI Tools for File Conversion in 2026
AI is transforming file conversion — from OCR that reads handwriting to video upscaling that adds detail. Here are the best AI-powered tools available now.