Skip to content

A video codec that encodes a video to 10% it's original size then decodes it back to its original form using chroma sub-sampling and delta encoding of video frames

Notifications You must be signed in to change notification settings

Mvoii/video_codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A rudimentary video codec

https://video-codec-v0.onrender.com/

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


on the webpage


https://video-codec-v0.onrender.com/

  1. Use the video.rgb24 file available in this repository
  2. upload the video, add its width 384 and height 216
  3. the video should be compressed and downloaded to your computer
  4. upload the compressed video, width 384, height 216 and number of frames 217
  5. the video should be decompressed and downloaded o your computer

play the videos using ffmpeg


type the command onto the terminal: ffplay -f rawvideo -pixel_format rgb24 -video_size 384x216 -framerate 25 <filename>.rgb24

references

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

About

A video codec that encodes a video to 10% it's original size then decodes it back to its original form using chroma sub-sampling and delta encoding of video frames

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published