Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 805 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 805 Bytes

A rudimentary video codec

Constraints

  1. The video size should end up smaller after the encoding
  2. The encoding is reversible
  3. The compressed video should contain enough information to be recongisable

technique


Consecutive frames have spatial redundancy, pixels in consecutive frames are likely to have similar information. This allows us to compress like how png does.

Each frame contains pixels -which contain three attribuutes: r, g, and b. This gives a total size of (width * height * 3) per frame.

We convert each frame to YUV420 format. Then for each 4 adjacent pixels, we average the chominance this reducing information stored by each pixels to 0.25

references

  1. https://github.com/kevmo314/codec-from-scratch
  2. ffmpeg blogs