{"id":13530942,"url":"https://github.com/phoboslab/pl_mpeg","last_synced_at":"2025-05-15T03:05:44.423Z","repository":{"id":43084159,"uuid":"191319497","full_name":"phoboslab/pl_mpeg","owner":"phoboslab","description":"Single file C library for decoding MPEG1 Video and MP2 Audio","archived":false,"fork":false,"pushed_at":"2025-02-06T16:36:01.000Z","size":74,"stargazers_count":847,"open_issues_count":14,"forks_count":66,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-21T04:01:57.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phoboslab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2019-06-11T07:40:06.000Z","updated_at":"2025-03-31T15:24:11.000Z","dependencies_parsed_at":"2024-01-03T04:00:16.312Z","dependency_job_id":"1488b55e-9f09-4791-bddf-ea167807ca12","html_url":"https://github.com/phoboslab/pl_mpeg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoboslab%2Fpl_mpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoboslab%2Fpl_mpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoboslab%2Fpl_mpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoboslab%2Fpl_mpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phoboslab","download_url":"https://codeload.github.com/phoboslab/pl_mpeg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264765,"owners_count":22041793,"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-08-01T07:00:58.201Z","updated_at":"2025-05-15T03:05:44.404Z","avatar_url":"https://github.com/phoboslab.png","language":"C","readme":"# PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer\n\nSingle-file MIT licensed library for C/C++\n\nSee [pl_mpeg.h](https://github.com/phoboslab/pl_mpeg/blob/master/pl_mpeg.h) for\nthe documentation.\n\n\n## Why?\n\nThis is meant as a simple way to get video playback into your app or game. Other\nsolutions, such as ffmpeg require huge libraries and a lot of glue code.\n\nMPEG1 is an old and inefficient codec, but it's still good enough for many use\ncases. All patents related to MPEG1 and MP2 have expired, so it's completely\nfree now.\n\nThis library does not make use of any SIMD instructions, but because of\nthe relative simplicity of the codec it still manages to decode 4k60fps video\non a single CPU core (on my i7-6700k at least).\n\n\n## Building\n\nA Makefile to build the example applications is included. \n\n- `pl_mpeg_extract_frames`: a command line tool that dumps all frames into BMPs\n- `pl_mpeg_player_gl`: a video player using SDL2 and OpenGL\n- `pl_mpeg_player_sdl`: a video player using SDL2 and it's built-in 2d renderer\n\nThe players require the SDL2 library to be installed.\n\n```shell\nmake # build all\nmake extract # only build pl_mpeg_extract_frames\nmake player_gl # only build pl_mpeg_player_gl\nmake player_sdl # only build pl_mpeg_player_sdl\n```\n\n\n## Encoding for PL_MPEG\n\nMost [MPEG-PS](https://en.wikipedia.org/wiki/MPEG_program_stream) (`.mpg`) files\ncontaining MPEG1 Video (\"mpeg1\") and MPEG1 Audio Layer II (\"mp2\") streams should\nwork with PL_MPEG. Note that `.mpg` files can also contain MPEG2 Video, which is\nnot supported by this library.\n\nYou can encode video in a suitable format using ffmpeg:\n\n```\nffmpeg -i input.mp4 -c:v mpeg1video -q:v 0 -c:a libtwolame -b:a 224k -format mpeg output.mpg\n```\n\n`-q:v` sets a fixed video quality with a variable bitrate, where `0` is the \nhighest. You may use `-b:v` to set a fixed bitrate instead; e.g. \n`-b:v 2000k` for 2000 kbit/s. Please refer to the \n[ffmpeg documentation](http://ffmpeg.org/ffmpeg.html#Options) for more details.\n\nIf you just want to quickly test the library, try this file:\n\nhttps://phoboslab.org/files/bjork-all-is-full-of-love.mpg\n\n\n## Limitations\n\n- no error reporting. PL_MPEG will silently ignore any invalid data.\n- the pts (presentation time stamp) for packets in the MPEG-PS container is\nignored. This may cause sync issues with some files.\n- bugs, probably.\n","funding_links":[],"categories":["Multimedia","Libraries"],"sub_categories":["C"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoboslab%2Fpl_mpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoboslab%2Fpl_mpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoboslab%2Fpl_mpeg/lists"}