ManagedCodecs.Core 0.8.0

dotnet add package ManagedCodecs.Core --version 0.8.0
                    
NuGet\Install-Package ManagedCodecs.Core -Version 0.8.0
                    
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.Core" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ManagedCodecs.Core" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="ManagedCodecs.Core" />
                    
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.Core --version 0.8.0
                    
#r "nuget: ManagedCodecs.Core, 0.8.0"
                    
#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.Core@0.8.0
                    
#: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.Core&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=ManagedCodecs.Core&version=0.8.0
                    
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; the package carries THIRD-PARTY-NOTICES.md, the notices of the projects some constant tables were transcribed from. The license covers the code, not the formats: codec patents (H.264, AAC) apply regardless of the language a decoder is written in.

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.
  • net10.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on ManagedCodecs.Core:

Package Downloads
ManagedCodecs.Mjpeg

Motion JPEG decoder (baseline and extended Huffman JPEG, interlaced AVI1), bit-exact with FFmpeg, in pure managed C# with SIMD.

ManagedCodecs.Containers

AVI, MP4 (and QuickTime, fragmented MP4, edit lists as FFmpeg applies them) and ADTS demuxers, in pure managed C#; Demuxer.Open picks one by content.

ManagedCodecs.Aac

AAC decoder (AAC LC mono to 7.1, HE-AAC with SBR and parametric stereo), checked against FFmpeg, in pure managed C#.

ManagedCodecs.H264

H.264 decoder (Constrained Baseline, Main, High, High 10, 4:2:2 and 4:4:4; CAVLC and CABAC, interlaced, 8 to 14 bits, lossless, frame threading), bit-exact with FFmpeg, in pure managed C#.

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 243 11/2/2026
0.6.0 215 11/1/2026
0.5.0 464 11/1/2026
0.4.0 659 10/30/2026
0.3.0 310 10/30/2026
0.2.5 189 10/30/2026
0.2.4 178 10/30/2026
0.2.3 227 10/29/2026
0.2.2 188 10/29/2026
0.2.1 167 10/29/2026
0.2.0 242 10/28/2026
0.1.0 553 10/27/2026
0.1.0-preview.3 76 10/27/2026
0.1.0-preview.2 73 10/26/2026
0.1.0-preview.1 82 10/26/2026