Git Product home page Git Product logo

mpeg's Introduction

mpeg

Status Go Reference Go Report Card

MPEG-1 Video decoder, MP2 Audio decoder and MPEG-PS Demuxer in pure Go.

Why

This is a simple way to get video playback into your app or game.

MPEG-1 is an old and inefficient codec, but it is still good enough for many use cases. The quality and compression ratio still holds up surprisingly well. Decoding costs very little CPU time compared to modern video formats. All patents related to MPEG-1 and MP2 have expired, so it is entirely free now.

Examples

  • frames - extracts all frames from a video and saves them as JPEG
  • player-eb - player using Ebitengine with YUV->RGB conversion done on CPU
  • player-rl - player using raylib with YUV->RGB conversion done on CPU
  • player-sdl - player using SDL2 with accelerated YUV->RGB conversion
  • player-web - player using WebGL and WebAudio, see live example

Format

Most MPEG-PS (.mpg) files containing MPEG-1 video (mpeg1video) and MPEG-1 Audio Layer II (mp2) streams should work.

Note that .mpg files can also contain MPEG-2 video, which this library does not support.

You can encode video in a suitable format with FFmpeg:

ffmpeg -i input.mp4 -c:v mpeg1video -q:v 16 -c:a mp2 -format mpeg output.mpg

-q:v sets a fixed video quality with a variable bitrate, where 0 is the highest. You can use -b:v to set a fixed bitrate instead; e.g. -b:v 2000k for 2000 kbit/s. Refer to the FFmpeg documentation for more details.

Credits

mpeg's People

Contributors

gen2brain avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

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.