HyperCodecs 1.0.0
See the version list below for details.
dotnet add package HyperCodecs --version 1.0.0
NuGet\Install-Package HyperCodecs -Version 1.0.0
<PackageReference Include="HyperCodecs" Version="1.0.0" />
<PackageVersion Include="HyperCodecs" Version="1.0.0" />
<PackageReference Include="HyperCodecs" />
paket add HyperCodecs --version 1.0.0
#r "nuget: HyperCodecs, 1.0.0"
#:package HyperCodecs@1.0.0
#addin nuget:?package=HyperCodecs&version=1.0.0
#tool nuget:?package=HyperCodecs&version=1.0.0
HyperCodecs
Sound and video containers and decoders written in managed C# for .NET 10 and .NET 11. This package loads no native library. For system sound output and hardware video decoding, add HyperCodecs.Platform. Everything reads and writes spans, works on Linux, Windows and macOS, and is trim and Native AOT safe.
HyperCodecs is part of the Hyper PDF Viewer family and lives at glennawatson/HyperCodecs.
Supported formats
| Kind | Formats |
|---|---|
| Containers | MP4 and M4A (including fragmented files), Matroska and WebM, Ogg, WAVE, FLAC files, raw ADTS AAC and MP3 |
| Sound | AAC-LC, MP3, FLAC, Opus, Vorbis, PCM |
| Video | H.264, H.265 |
Decode sound
using HyperCodecs;
using var container = MediaContainers.Open("song.m4a") ?? throw new InvalidDataException("Unsupported file.");
var index = container.FindTrack(MediaTrackKind.Audio);
using var decoder = AudioDecoders.Create(container.Tracks[index]) ?? throw new InvalidDataException("Unsupported codec.");
var pcm = new PcmBuffer();
var packet = new MediaPacket();
while (container.ReadPacket(packet))
{
if (packet.Track == index)
{
decoder.Decode(packet, pcm);
// Read pcm.Samples here, then clear the buffer for the next packet.
pcm.Clear();
}
}
PcmBuffer.Samples holds interleaved 32-bit float samples between -1 and 1. decoder.SampleRate and decoder.Channels describe them.
Decode video
VideoDecoders.Create returns a decoder for an H.264 or H.265 track. Decode adds finished pictures to a List<VideoFrame> in display order, and Flush adds the pictures still held back at the end. Give a frame back with Recycle when you are done with it so the decoder can reuse its planes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on HyperCodecs:
| Package | Downloads |
|---|---|
|
HyperCodecs.Platform
Operating system sound output and hardware video decoding for HyperCodecs: WASAPI and Media Foundation on Windows, Audio Toolbox and VideoToolbox on Apple systems, AudioTrack and MediaCodec on Android, and a plain build with none. Linux has its own package, HyperCodecs.Platform.Linux. Each build holds only the code for its own system, and the managed decoders in HyperCodecs remain the fallback. |
|
|
HyperCodecs.Platform.Linux
PulseAudio (and PipeWire) sound output and VA-API hardware video decoding for HyperCodecs on Linux. |
GitHub repositories
This package is not used by any popular GitHub repositories.