No history yet

Understanding Video Compression

How Video Compression Works

A raw, uncompressed video file is enormous. A single minute of high-definition footage can take up gigabytes of space. To make video practical for streaming, sharing, and storing, we need to make those files much smaller. This is where compression comes in.

Video compression works by cleverly removing redundant information. Think about a video of someone talking. For several seconds, the background stays exactly the same. Instead of storing the information for every single pixel in the background for every frame, a compression algorithm can just store the background once and then only record the parts of the image that change, like the person's mouth moving.

This process targets two types of redundancy:

  1. Spatial Redundancy: This is redundancy within a single frame. For example, a large patch of blue sky has a lot of similar pixels next to each other. The algorithm can simplify this by saying, "this whole area is blue" instead of describing each pixel individually.
  2. Temporal Redundancy: This is redundancy between consecutive frames. As mentioned in the talking head example, most of the scene doesn't change from one frame to the next. The algorithm predicts the next frame based on the previous one and only saves the differences.

To do this, video files rely on a special piece of software or hardware.

Codec

noun

A program or device that uses an algorithm to compress and decompress digital data, especially video. The name is a blend of "coder-decoder."

Codecs are responsible for compressing and decompressing digital video content.

Meet the Codecs

Different codecs use different algorithms to shrink video files. They are constantly evolving to become more efficient, meaning they can achieve smaller file sizes at the same level of quality. Two of the most common codecs you'll encounter today are H.264 and H.265.

CodecAlso Known AsKey Feature
H.264Advanced Video Coding (AVC)The long-time industry standard. It's compatible with almost every device and platform.
H.265High Efficiency Video Coding (HEVC)The successor to H.264. It offers about 50% better compression, but is less universally supported.

Essentially, H.265 can deliver the same quality as H.264 in a file that's half the size. This makes it ideal for 4K streaming and situations where bandwidth or storage space is limited. However, the incredible compatibility of H.264 keeps it relevant and widely used across the web.

The Quality Trade-Off

Compression is a balancing act. The process of removing data to shrink a file is almost always "lossy," which means some of the original information is permanently discarded. You can't un-compress a file and get back to the exact original.

The more you compress a video, the more data gets thrown away. This leads to a smaller file, but it also introduces visual imperfections known as compression artifacts. You might see blocky patterns, blurry motion, or strange color distortions.

Lesson image

The key is to find the sweet spot where the file size is manageable, but the quality loss is not distracting to the viewer. For a TikTok video you want to email, you'll need to accept some quality reduction to get the file size down.

Ready to test your knowledge?

Quiz Questions 1/5

What is the primary goal of video compression?

Quiz Questions 2/5

A compression algorithm simplifies a large area of blue sky in a single frame by describing it as one color instead of storing data for each individual pixel. This technique targets which type of redundancy?

Understanding these basics helps you make informed decisions when you need to shrink a video file for any purpose.