How Streaming Video Compresses Without Looking Bad
I/P/B frames, DCT, motion estimation, and adaptive bitrate
Related Tools
Related Labs
Related Worksheets
Related Cheat Sheets
Streaming video looks smooth because a codec removes information that viewers are unlikely to notice while keeping the important structure of each frame. Raw video is enormous, so sending every pixel of every frame would overwhelm most internet connections. Compression makes movies, livestreams, and short clips practical on phones, laptops, and TVs. The goal is not perfect copying, but a visually convincing version that uses far fewer bits.
Modern codecs use several layers of smart prediction and simplification. They store some complete reference frames, then describe many later frames by how blocks of pixels moved or changed. They also transform image details into frequency patterns, reduce less visible detail, and adjust quality based on network speed. Adaptive bitrate streaming lets the video player switch between versions so playback continues smoothly instead of constantly buffering.
Key Facts
- Raw bitrate = width x height x frames per second x bits per pixel.
- Compression ratio = raw file size / compressed file size.
- I-frames store a complete image, while P-frames and B-frames store predicted changes from nearby frames.
- Motion estimation saves bits by representing moving image blocks with motion vectors instead of resending all pixels.
- DCT separates a block into low-frequency and high-frequency visual detail so less noticeable detail can be reduced.
- Bitrate = file size in bits / playback time in seconds.
Vocabulary
- Codec
- A codec is an algorithm or system that encodes video into a smaller form and decodes it for playback.
- I-frame
- An I-frame is a self-contained video frame that can be decoded without using other frames.
- Motion vector
- A motion vector describes how a block of pixels moves from one frame to another.
- Perceptual masking
- Perceptual masking is the use of human vision limits to hide compression loss in areas where viewers are less likely to notice it.
- Adaptive bitrate streaming
- Adaptive bitrate streaming delivers video in small chunks at different quality levels and switches among them based on network conditions.
Common Mistakes to Avoid
- Thinking compression only makes the image smaller, which is wrong because video compression also predicts motion across time and reuses information between frames.
- Assuming a higher resolution always looks better, which is wrong because low bitrate 4K can look worse than well-encoded 1080p with fewer artifacts.
- Confusing frame rate with bitrate, which is wrong because frame rate counts frames per second while bitrate measures how many bits are delivered per second.
- Treating all codecs as equal at the same bitrate, which is wrong because newer codecs such as AV1 often preserve more detail than older codecs such as H.264 at similar bitrates.
Practice Questions
- 1 A raw 1920 x 1080 video plays at 30 fps with 24 bits per pixel. What is its raw bitrate in bits per second and in megabits per second?
- 2 A 10 minute video stream uses an average bitrate of 5 Mbps. How many megabits are transferred, and about how many megabytes is that?
- 3 A video player drops from a 6 Mbps version to a 3 Mbps version during a crowded Wi-Fi session. Explain how adaptive bitrate streaming can reduce buffering while still trying to keep the video watchable.