Skip to content
/ mpeg Public

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

License

Notifications You must be signed in to change notification settings

gen2brain/mpeg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages