ManagedCodecs.Aac 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ManagedCodecs.Aac --version 0.2.1
                    
NuGet\Install-Package ManagedCodecs.Aac -Version 0.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ManagedCodecs.Aac" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ManagedCodecs.Aac" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="ManagedCodecs.Aac" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ManagedCodecs.Aac --version 0.2.1
                    
#r "nuget: ManagedCodecs.Aac, 0.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ManagedCodecs.Aac@0.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ManagedCodecs.Aac&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=ManagedCodecs.Aac&version=0.2.1
                    
Install as a Cake Tool

ManagedCodecs

Pure managed C# media decoders: no native binaries, Native AOT friendly, and running on WebAssembly too. Every decoder is checked against FFmpeg sample by sample.

  • H.264: Constrained Baseline to High 4:4:4 Predictive. CAVLC and CABAC, I/P/B, interlaced (MBAFF and field pictures), 4:0:0 to 4:4:4, 8 to 14 bits, lossless; bit-exact with FFmpeg. Frame threading and error concealment on request.
  • MJPEG: baseline and extended Huffman JPEG, interlaced AVI1; bit-exact with FFmpeg.
  • AAC LC and HE-AAC (SBR, parametric stereo): mono to 7.1, within 2^-17 of FFmpeg's float output for AAC LC.
  • Containers: AVI, MP4 (fragmented files and edit lists too) and raw AAC (ADTS), packets and timestamps as FFmpeg's demuxers give them.

The packages: ManagedCodecs for everything, or one of ManagedCodecs.Containers, ManagedCodecs.Mjpeg, ManagedCodecs.H264 and ManagedCodecs.Aac, each with ManagedCodecs.Core. They share internals, so each depends on the others at exactly its own version.

Decoding a file

Packets go in in decode order; frames come out in display order, each with the Pts of its packet. Decode returns zero or more frames (H.264 can hold frames back for reordering) and Flush the rest:

using ManagedCodecs;
using ManagedCodecs.Containers;
using ManagedCodecs.H264;
using ManagedCodecs.Mjpeg;

using var demuxer = Demuxer.Open("video.mp4");
var video = demuxer.Video!;
IVideoDecoder decoder = video.Codec == CodecIds.H264 ? new H264Decoder(video) : new MjpegDecoder(video);

foreach (var packet in demuxer.ReadPackets().Where(p => p.StreamIndex == video.StreamIndex))
{
    foreach (var frame in decoder.Decode(packet))
    {
        Show(frame); // frame.Pts is in video.TimeBase; frame.GetRow(plane, y) reads its samples
    }
}

foreach (var frame in decoder.Flush())
{
    Show(frame);
}

Publishing with Native AOT on x64: set <IlcInstructionSet>x86-64-v3</IlcInstructionSet> (AVX2) in the app, or the 256-bit paths are left out and AAC and HE-AAC take about a third longer (README, Native AOT).

Audio goes the same way: new AacDecoder(demuxer.Audio!) returns an AudioFrame of float samples per packet. Every decoder and demuxer also has an async API (ReadPacketsAsync, DecodeAsync, FlushAsync).

More

The repository has the full documentation: the README (the API in detail, threading, malformed input, WebAssembly, speed against FFmpeg), what each feature is checked against, and the changelog. MIT licensed.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ManagedCodecs.Aac:

Package Downloads
ManagedCodecs

Pure managed C# media codecs, every package at once: MJPEG and H.264 (bit-exact with FFmpeg), AAC and HE-AAC, AVI, MP4 and ADTS demuxing. No native binaries, Native AOT friendly.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 0 11/4/2026
0.7.0 195 11/2/2026
0.6.0 162 11/1/2026
0.5.0 437 11/1/2026
0.4.0 617 10/30/2026
0.3.0 269 10/30/2026
0.2.5 145 10/30/2026
0.2.4 135 10/30/2026
0.2.3 173 10/29/2026
0.2.2 140 10/29/2026
0.2.1 119 10/29/2026
0.2.0 186 10/28/2026
0.1.0 516 10/27/2026
0.1.0-preview.3 56 10/27/2026
0.1.0-preview.2 54 10/26/2026
0.1.0-preview.1 61 10/26/2026