{"id":8915971,"url":"https://github.com/gen2brain/mpeg","last_synced_at":"2025-05-12T14:30:18.556Z","repository":{"id":61925188,"uuid":"556299931","full_name":"gen2brain/mpeg","owner":"gen2brain","description":"MPEG-1 Video decoder, MP2 Audio decoder and MPEG-PS Demuxer in pure Go","archived":false,"fork":false,"pushed_at":"2024-05-07T22:04:31.000Z","size":22392,"stargazers_count":139,"open_issues_count":4,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-12T14:30:06.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gen2brain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-23T14:39:16.000Z","updated_at":"2025-04-12T14:44:39.000Z","dependencies_parsed_at":"2024-05-07T19:45:35.770Z","dependency_job_id":"baf22d7c-f840-4e2f-81ba-f19ccf7ef711","html_url":"https://github.com/gen2brain/mpeg","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"c94dca7127ba6a85d78005f8b00b021f128fbac2"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fmpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fmpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fmpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fmpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gen2brain","download_url":"https://codeload.github.com/gen2brain/mpeg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253754954,"owners_count":21958933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-05-01T23:10:31.955Z","updated_at":"2025-05-12T14:30:18.446Z","avatar_url":"https://github.com/gen2brain.png","language":"Go","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"## mpeg\n[![Status](https://github.com/gen2brain/mpeg/actions/workflows/test.yml/badge.svg)](https://github.com/gen2brain/mpeg/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/gen2brain/mpeg.svg)](https://pkg.go.dev/github.com/gen2brain/mpeg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gen2brain/mpeg?branch=main)](https://goreportcard.com/report/github.com/gen2brain/mpeg) \n\n`MPEG-1` Video decoder, `MP2` Audio decoder and `MPEG-PS` Demuxer in pure Go.\n\n### Why\n\nThis is a simple way to get video playback into your app or game.\n\n`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.\nDecoding 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.\n\n### Examples\n\n- [frames](https://github.com/gen2brain/mpeg-examples/blob/main/frames) - extracts all frames from a video and saves them as JPEG\n- [player-eb](https://github.com/gen2brain/mpeg-examples/blob/main/player-eb) - player using `Ebitengine`, also check better, [accelerated example](https://github.com/hajimehoshi/ebiten/tree/main/examples/video)\n- [player-rl](https://github.com/gen2brain/mpeg-examples/blob/main/player-rl) - player using `raylib` with YUV-\u003eRGB conversion done on CPU\n- [player-sdl](https://github.com/gen2brain/mpeg-examples/blob/main/player-sdl) - player using `SDL2` with accelerated YUV-\u003eRGB conversion\n- [player-web](https://github.com/gen2brain/mpeg-examples/blob/main/player-web) - player using `WebGL` and `WebAudio`, see [live example](https://gen2brain.github.io/mpeg)\n- [player-xv](https://github.com/gen2brain/mpeg-examples/blob/main/player-xv) - player using `X11/XVideo` and `OSS`, accelerated\n\n### Format\n\nMost [MPEG-PS](https://en.wikipedia.org/wiki/MPEG_program_stream) (`.mpg`) files containing [MPEG-1](https://en.wikipedia.org/wiki/MPEG-1) video (`mpeg1video`) and [MPEG-1 Audio Layer II](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_II) (`mp2`) streams should work.\n\nNote that `.mpg` files can also contain [MPEG-2](https://en.wikipedia.org/wiki/MPEG-2) video, which this library does not support.\n\nYou can encode video in a suitable format with `FFmpeg`:\n```\nffmpeg -i input.mp4 -c:v mpeg1video -q:v 16 -c:a mp2 -format mpeg output.mpg\n```\n\n`-q:v` sets a fixed video quality with a variable bitrate, where `0` is the highest.\nYou can use `-b:v` to set a fixed bitrate instead; e.g. `-b:v 2000k` for 2000 kbit/s.\nRefer to the [FFmpeg documentation](https://ffmpeg.org/ffmpeg.html#Options) for more details.\n\n### Credits\n\n* [pl_mpeg](https://github.com/phoboslab/pl_mpeg) by Dominic Szablewski.\n* [javampeg1video](https://sourceforge.net/projects/javampeg1video/) by Korandi Zoltan.\n* [kjmp2](https://keyj.emphy.de/kjmp2/) by Martin J. Fiedler.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fmpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgen2brain%2Fmpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fmpeg/lists"}