The Video File Size Problem
A single minute of uncompressed 4K video at 30 frames per second takes about 30 gigabytes of storage. A two-hour movie in this format would require 3.6 terabytes. Even a short YouTube video would require more storage than most laptops have.
Clearly, video compression is essential. Modern video compression can reduce file sizes by 100x to 1000x while maintaining visually identical quality. But compression is not magic—understanding how it works helps you make better decisions about your video workflow.
How Video Compression Works
Video compression exploits two key facts about video content:
Spatial Redundancy
Within a single frame, neighboring pixels are usually very similar. A patch of blue sky, a wall, or a person's skin all contain lots of similar pixel values. Compression algorithms group similar pixels together and store them more efficiently.
Temporal Redundancy
Between consecutive frames, most of the image usually stays the same. If the camera is stationary and only a person is moving, the background doesn't change at all. Compression algorithms can store the background once and only encode the changes.
Modern codecs combine these techniques with sophisticated math to achieve remarkable compression while maintaining visual quality.
The Codec Zoo
A codec (coder/decoder) is the algorithm used to compress and decompress video. There are many codecs, each with different strengths:
H.264 (AVC)
H.264 is the most widely used video codec in the world. It's the standard for Blu-ray discs, broadcast television, YouTube, and most video conferencing. Released in 2003, it has been refined over the years to provide excellent quality at relatively low bitrates.
Strengths:
- Universal compatibility across all modern devices
- Mature encoding tools with excellent quality
- Hardware decoding support in virtually all devices
- Well-understood by all video professionals
Weaknesses:
- Less efficient than newer codecs (HEVC, AV1)
- Limited to 8-bit color (no HDR support natively)
- Patent licensing complexity
Best for: Maximum compatibility, professional video production, general purpose use.
H.265 (HEVC)
H.265 is the successor to H.264, providing about 50% better compression at the same quality. It's increasingly used for 4K content, HDR video, and modern streaming.
Strengths:
- About 50% smaller files than H.264 at same quality
- Supports 10-bit color and HDR
- Hardware decoding in modern devices
Weaknesses:
- More complex licensing than H.264
- Limited support in older devices
- Slower to encode than H.264
Best for: 4K content, HDR video, modern streaming, archiving.
VP9
VP9 is Google's open-source codec, used primarily for YouTube and other Google services. It provides similar quality to HEVC but is completely royalty-free.
Strengths:
- Royalty-free
- Similar quality to HEVC
- Wide support in modern browsers
Weaknesses:
- Limited support outside web browsers
- Slower to encode than H.264
Best for: Web video, especially YouTube and Google services.
AV1
AV1 is the newest mainstream codec, developed by the Alliance for Open Media (which includes Google, Apple, Microsoft, Netflix, and others). It provides 20-30% better compression than HEVC and is completely royalty-free.
Strengths:
- Best compression of any practical codec
- Royalty-free
- Supported by all major browsers
- Good hardware support emerging
Weaknesses:
- Slow to encode (though this is improving)
- Limited support in older devices
- Decoding is more CPU-intensive
Best for: Modern web video, streaming, future-proofing.
Resolution and Bitrate
Resolution
Resolution refers to the number of pixels in the video frame. Common resolutions include:
- 480p (SD): 854x480
- 720p (HD): 1280x720
- 1080p (Full HD): 1920x1080
- 1440p (QHD): 2560x1440
- 2160p (4K UHD): 3840x2160
- 4320p (8K): 7680x4320
Higher resolution means more detail but also larger files. The right resolution depends on the viewing context—4K is great for TVs but unnecessary for mobile phones.
Bitrate
Bitrate is the amount of data used per second of video, measured in bits per second (bps) or megabits per second (Mbps). Higher bitrate means better quality but larger files.
For H.264 encoding, here are some common bitrate recommendations:
| Resolution | Quality | Bitrate |
|---|---|---|
| ------------ | --------- | --------- |
| 480p | Low | 500-1000 kbps |
| 480p | Medium | 1000-1500 kbps |
| 480p | High | 1500-3000 kbps |
| 720p | Low | 1500-3000 kbps |
| 720p | Medium | 3000-5000 kbps |
| 720p | High | 5000-8000 kbps |
| 1080p | Low | 3000-5000 kbps |
| 1080p | Medium | 5000-8000 kbps |
| 1080p | High | 8000-12000 kbps |
| 4K | Medium | 15000-25000 kbps |
| 4K | High | 35000-68000 kbps |
These are starting points—the optimal bitrate depends heavily on the content. A screencast with mostly static content can use much lower bitrate than a fast-paced action scene.
Frame Rate
Frame rate is the number of frames displayed per second. Common frame rates:
- 24 fps: Cinematic look, standard for movies
- 25 fps: PAL television standard
- 30 fps: NTSC television standard, common for online video
- 50 fps: Higher quality PAL
- 60 fps: Higher quality NTSC, common for gaming video
- 120 fps: Used for slow-motion and high-frame-rate displays
Higher frame rates mean smoother motion but larger files. For most online video, 30 fps is sufficient. For sports or gaming content, 60 fps is preferred. Slow-motion content may require 120 fps or higher.
Quality Settings
When encoding video, you typically choose between:
Constant Bitrate (CBR)
The bitrate stays the same throughout the video. Simple, but may waste bits on simple scenes and starve complex scenes of quality.
Variable Bitrate (VBR)
The bitrate varies based on the content. More bits are allocated to complex scenes and fewer to simple ones. Generally produces better quality for the same file size, but encoding is slower.
Constant Quality (CQ) or Constant QP
Instead of targeting a bitrate, the encoder targets a quality level. This is generally the best choice for archival and maximum quality, but the file size can vary significantly.
For most uses, VBR is a good compromise—better quality than CBR, with more predictable file sizes than CQ.
Two-Pass Encoding
Two-pass encoding analyzes the entire video in the first pass, then encodes it optimally in the second pass. The first pass identifies which scenes are complex and which are simple, allowing the second pass to allocate bits optimally.
Two-pass encoding produces better quality at the same file size, but takes about twice as long. For important videos that will be viewed many times, two-pass is worth the extra encoding time.
Practical Compression Tips
1. Choose the right resolution
Don't encode at higher resolution than needed. If your audience watches on phones, 1080p is usually the maximum sensible resolution.
2. Choose the right codec
For maximum compatibility, use H.264. For better compression with modern devices, use HEVC or AV1. For web video, AV1 is increasingly the best choice.
3. Match bitrate to content
Static content (screencasts, presentations) needs much lower bitrate than dynamic content (sports, action). Analyze your content to set appropriate bitrates.
4. Use two-pass encoding for important content
For videos that will be viewed many times, the extra encoding time for two-pass is worth it.
5. Consider perceptual quality, not just metrics
Objective quality metrics (PSNR, SSIM, VMAF) don't always match human perception. A video with a slightly lower metric score may actually look better to viewers.
6. Don't over-compress
At very low bitrates, all codecs produce visible artifacts—blocking, banding, mosquito noise. If your file size requirements force extremely low bitrates, consider reducing resolution or frame rate instead.
7. Test with actual content
Always test your encoding settings with actual content, not just standard test clips. Different content types (animation, sports, talking heads) have very different compression characteristics.
Common Use Cases
Streaming to the Web
Use H.264 for maximum compatibility or AV1 for best efficiency. Encode at multiple bitrates (called "ladder encoding") so viewers get the best quality for their connection speed.
Sharing on Social Media
Each social platform has its own encoding recommendations. Generally, use H.264 at high bitrate, 1080p, 30 fps for best results.
Archiving Important Content
Use a high-quality codec (HEVC or AV1) with high bitrate and two-pass encoding. Include multiple audio tracks and subtitle tracks for international content.
Video Calls
Use VP8, VP9, or AV1 at low bitrate (500-1500 kbps) and low resolution (480p or 720p). Latency is more important than quality for video calls.
Editing and Post-Production
Use a high-quality intermediate codec like ProRes or DNxHD for editing. These codecs prioritize quality and editing performance over file size. Only compress to a delivery codec when you're done editing.
Tools for Video Compression
For online compression, our video tools offer browser-based processing with sensible defaults. For professional work, FFmpeg is the most powerful video tool available—command-line, but with virtually unlimited capability.
Popular GUI tools include HandBrake (open source), Adobe Media Encoder (paid), and DaVinci Resolve (free version available).
The Future of Video Compression
VVC (H.266) is the next generation, promising 50% better compression than HEVC. AV2 is being developed as the successor to AV1. Both are still early in their adoption curves.
For now, the practical recommendation is:
- For web delivery: AV1 with H.264 fallback
- For general purpose: H.264 at appropriate bitrate
- For 4K/HDR: HEVC or AV1
- For archival: HEVC or AV1 at high bitrate with two-pass
Understanding video compression helps you make informed decisions about quality, file size, and compatibility. The right choices depend on your specific use case, but the principles covered in this guide apply universally. With the right encoding settings, you can dramatically reduce file sizes while maintaining excellent visual quality.
About the Author
ChDaoAI Media Team — The ChDaoAI team consists of passionate engineers, designers, and content creators who are dedicated to making powerful AI tools accessible to everyone.