Giter Club home page Giter Club logo

codec-from-scratch's Introduction

Video Encoding from Scratch

Big fan of video? Have questions or want to learn more? Join us on Discord!

Ever wondered how a video encoder works? This is a simple video encoder that walks through building a video encoder from scratch to achieve a 90% compression ratio!

production.ID_4823190.1.mp4

Start by opening up main.go. You can run the code by running cat video.rgb24 | go run main.go and you should see this as output

$ cat video.rgb24 | go run main.go
2022/11/23 13:54:03 Raw size: 53996544 bytes
2022/11/23 13:54:03 YUV420P size: 26998272 bytes (50.00% original size)
2022/11/23 13:54:03 RLE size: 13592946 bytes (25.17% original size)
2022/11/23 13:54:15 DEFLATE size: 5457415 bytes (10.11% original size)

The actual encoding is done in about 120 lines of code. This is meant to be a didactic exercise rather than a comprehensive guide, but maybe if there's interest we could add more features that appear in modern video codecs.

Sample video from Ketut Subiyanto.

Other languages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.