{"id":17041702,"url":"https://github.com/xlab/libvpx-go","last_synced_at":"2025-04-09T13:05:41.401Z","repository":{"id":44623140,"uuid":"69389914","full_name":"xlab/libvpx-go","owner":"xlab","description":"Package vpx provides Go bindings for libvpx-1.6.0, the WebM Project VP8/VP9 codec implementation.","archived":false,"fork":false,"pushed_at":"2022-02-03T23:38:24.000Z","size":3428,"stargazers_count":196,"open_issues_count":10,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T11:05:33.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.webmproject.org/code/","language":"C","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/xlab.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}},"created_at":"2016-09-27T19:11:49.000Z","updated_at":"2025-02-05T03:30:02.000Z","dependencies_parsed_at":"2022-08-28T15:21:41.845Z","dependency_job_id":null,"html_url":"https://github.com/xlab/libvpx-go","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/xlab%2Flibvpx-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Flibvpx-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Flibvpx-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Flibvpx-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xlab","download_url":"https://codeload.github.com/xlab/libvpx-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045231,"owners_count":21038553,"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-10-14T09:13:16.945Z","updated_at":"2025-04-09T13:05:41.383Z","avatar_url":"https://github.com/xlab.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"libvpx-go [![GoDoc](https://godoc.org/github.com/xlab/libvpx-go/vpx?status.svg)](https://godoc.org/github.com/xlab/libvpx-go/vpx)\n=========\n\nPackage `vpx` provides Go bindings for [libvpx-1.8.0](http://www.webmproject.org/code/), the WebM Project VPx codec implementation.\nAll the binding code has automatically been generated with rules defined in [vpx.yml](/vpx.yml).\n\n### Usage\n\n```bash\n$ brew install libvpx # \u003e= 1.8\n$ brew install pkg-config\n# (or use your package manager)\n\n$ go get github.com/xlab/libvpx-go/vpx\n```\n\n### Demo application\n\nThere is a simple WebM player with support of VP8/VP9 video and Vorbis/Opus audio implemnted, see [cmd/webm-player](cmd/webm-player). To get videos to play you can use [youtube-dl](https://github.com/rg3/youtube-dl) tool that is very convenient. It supports all the formats that are in WebM container, the player would automatically find video andaudio streams in a single file or in both (only video + only audio), see usage examples below.\n\n#### Install deps (demo app)\n\nSee also GLFW for Windows installation guide at [github.com/golang-ui/nuklear](https://github.com/golang-ui/nuklear#installation-of-nk).\n\n```bash\n$ brew install libvpx # \u003e= 1.8\n$ brew install libogg libvorbis opus portaudio\n# (or use your package manager)\n\n$ go get github.com/xlab/libvpx-go/cmd/webm-player\n\n$ webm-player -h\nA simple WebM player with support of VP8/VP9 video and Vorbis/Opus audio. Version: v1.0rc1\n\nUsage: webm-player \u003cfile1.webm\u003e [file2.webm]\n```\n\nFor Linux (e.g. Debian Sid):\n\n```\n$ apt-get install libvpx-dev libogg-dev libvorbis-dev libopus-dev portaudio19-dev\n$ go get github.com/xlab/libvpx-go/cmd/webm-player\n```\n\n#### Software used\n\nThere is a list of libraries used to build this app:\n\n* [go-gl/glfw](http://github.com/go-gl/glfw) — Go bindings for multi-platform library for OpenGL, OpenGL ES and Vulkan development, used here to init the GL context, window and handle the input events;\n* [golang-ui/nuklear](https://github.com/golang-ui/nuklear) — Go bindings for [nuklear.h](https://github.com/vurtun/nuklear) — a small ANSI C GUI library, used here to build the GUI layout, display the video frame as image, handle events sent by GLFW;\n* [ebml-go/ebml](https://github.com/ebml-go/ebml) — a pure Go implementation of an [EBML](http://matroska-org.github.io/libebml/specs.html) decoder (by Jorge Acereda Macia);\n* [ebml-go/webm](https://github.com/ebml-go/webm) — a pure Go implementation of a parser, reader and seeker for [WebM container](http://www.webmproject.org/docs/container/), uses EBML to decode the WebM metadata (by Jorge Acereda Macia);\n* [libvpx](https://github.com/xlab/libvpx-go) — Go bindings for libvpx-1.8.0, the WebM Project VP8/VP9 codec implementation;\n* [vorbis](https://github.com/xlab/vorbis-go) — Go bindings for OggVorbis implementation by the Xiph.Org Foundation;\n* [opus](https://github.com/xlab/opus-go) — Go bindings for Opus implementation by the Xiph.Org Foundation;\n* [portaudio](https://github.com/xlab/portaudio-go) — Go bindings for PortAudio, a free, cross-platform, open-source, audio I/O library.\n\n#### Usage\n\nPlease keep in mind that this actually is a **VP8/VP9 decoding demo**, yet though it does audio decoding well too. Video frames are converted to RGBA using a software decoder (a function), moving that to GPU would give it a boost for 720p+ resolutions, but this is left as an excercise for you, pull requests are welcome. Also audio synchronisation is poor, I invested a couple of hours but I'm lazy to get it done right. Also no pause button, sorry.\n\n```bash\n$ youtube-dl -F w2DpLW374Sg # list all formats\n$ youtube-dl -f 247 w2DpLW374Sg # webm 1280x720 vp9, 30fps, video only, 71.90MiB\n$ youtube-dl -f 251 w2DpLW374Sg # webm audio only, opus @160k (48000Hz), 8.92MiB\n\n$ webm-player ~/Downloads/w2DpLW374Sg.webm ~/Downloads/w2DpLW374Sg_opus.webm\n2016/09/27 21:43:38 glfw: created window 800x500\n2016/09/27 21:43:38 webm: found video track: 1280x720 dur: 9m54s V_VP9\n2016/09/27 21:43:38 webm: found audio track: ch: 2 48000.0Hz, dur: 9m54s, codec: A_OPUS\n2016/09/27 21:43:38 [INFO] took Video from the first stream, Audio from the second\n```\n\n\u003ca href=\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\"\u003e\u003cimg alt=\"webm player golang 8bit\" src=\"assets/demo2.png\" width=\"800px\"/\u003e\u003c/a\u003e\n\n\n```bash\n$ youtube-dl -f 43 5kj5ApnhPAE # webm  640x360   medium , vp8.0,  vorbis@128k\n\n$ webm-player ~/Downloads/5kj5ApnhPAE.webm\n2016/09/27 21:40:43 glfw: created window 800x500\n2016/09/27 21:40:43 webm: found video track: 640x360 dur: 12m30s V_VP8\n2016/09/27 21:40:43 webm: found audio track: ch: 1 44100.0Hz, dur: 12m30s, codec: A_VORBIS\n```\n\n\u003ca href=\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\"\u003e\u003cimg alt=\"webm player golang rob\" src=\"assets/demo1.png\" width=\"800px\"/\u003e\u003c/a\u003e\n\n#### FAQ\n\n\u003e Does it support rick roll?\n\nYes, it does.\n\n### Rebuilding the package\n\nYou will need to get the [c-for-go](https://git.io/c-for-go) tool installed first.\n\n```\n$ git clone https://github.com/xlab/libvpx-go \u0026\u0026 cd libvpx-go\n$ make clean\n$ make\n```\n\n## License\n\nAll the code except when stated otherwise is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlab%2Flibvpx-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxlab%2Flibvpx-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlab%2Flibvpx-go/lists"}