Top 5.7% dependent packages on proxy.golang.org
Top 4.8% dependent repos on proxy.golang.org
Top 6.7% forks on proxy.golang.org
proxy.golang.org : 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.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/gen2brain/mpeg
License: MIT
Latest release: about 1 year ago
First release: over 2 years ago
Namespace: github.com/gen2brain
Dependent packages: 5
Dependent repositories: 1
Stars: 97 on GitHub
Forks: 9 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 9 days ago