Ecosyste.ms: Repos

An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: github.com/gen2brain/mpeg

Package mpeg implements MPEG-1 Video decoder, MP2 Audio decoder and MPEG-PS demuxer. This library provides several interfaces to demux and decode MPEG video and audio data. A high-level MPEG API combines the demuxer, video and audio decoders in an easy-to-use wrapper. With the high-level interface you have two options to decode video and audio: 1. Decode() and just hand over the delta time since the last call. It will decode everything needed and call your callbacks (specified through Set{Video|Audio}Callback()) any number of times. 2. Use DecodeVideo() and DecodeAudio() to decode exactly one frame of video or audio data at a time. How you handle the synchronization of both streams is up to you. If you only want to decode video *or* audio through these functions, you should disable the other stream (Set{Video|Audio}Enabled(false)) Video data is decoded into a struct with all 3 planes (Y, Cb, Cr) stored in separate buffers, you can get image.YCbCr via YCbCr() function. You can either convert to image.RGBA on the CPU (slow) via the RGBA() function or do it on the GPU with the following matrix: Audio data is decoded into a struct with separate []float32 slices for left and right channel, and with a single []float32 slice with the samples for the left and right channel interleaved. You can convert interleaved samples to byte slice via the Bytes() function. There should be no need to use the lower level Demux, Video and Audio, if all you want to do is read/decode an MPEG-PS file. However, if you get raw mpeg1video data or raw mp2 audio data from a different source, these functions can be used to decode the raw data directly. Similarly, if you only want to analyze an MPEG-PS file or extract raw video or audio packets from it, you can use the Demux.
4 versions
Latest release: over 1 year ago
1 dependent package

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/gen2brain/mpeg

View more repository details: https://repos.ecosyste.ms/hosts/GitHub/repositories/gen2brain%2Fmpeg

Dependent Repos 1

tinne26/mpegg
Simple way to use gen2brain/mpeg with Ebitengine.
  • v0.2.2 go.mod
  • v0.2.2 go.sum

Size: 39.1 KB - Last synced: about 2 months ago - Pushed: about 2 months ago

zwh8800/ts2hls
  • v0.2.2 go.mod

Size: 31.3 KB - Last synced: about 2 months ago - Pushed: about 1 year ago

maxg95/ghost
  • v0.2.2 go.mod
  • v0.2.2 go.sum

Size: 8.29 MB - Last synced: 28 days ago - Pushed: 28 days ago