ManagedCodecs.Core
0.7.0
See the version list below for details.
dotnet add package ManagedCodecs.Core --version 0.7.0
NuGet\Install-Package ManagedCodecs.Core -Version 0.7.0
<PackageReference Include="ManagedCodecs.Core" Version="0.7.0" />
<PackageVersion Include="ManagedCodecs.Core" Version="0.7.0" />
<PackageReference Include="ManagedCodecs.Core" />
paket add ManagedCodecs.Core --version 0.7.0
#r "nuget: ManagedCodecs.Core, 0.7.0"
#:package ManagedCodecs.Core@0.7.0
#addin nuget:?package=ManagedCodecs.Core&version=0.7.0
#tool nuget:?package=ManagedCodecs.Core&version=0.7.0
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 | 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. |
-
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 | 325 | 11/2/2026 |
| 0.6.0 | 224 | 11/1/2026 |
| 0.5.0 | 474 | 11/1/2026 |
| 0.4.0 | 687 | 10/30/2026 |
| 0.3.0 | 316 | 10/30/2026 |
| 0.2.5 | 197 | 10/30/2026 |
| 0.2.4 | 183 | 10/30/2026 |
| 0.2.3 | 234 | 10/29/2026 |
| 0.2.2 | 195 | 10/29/2026 |
| 0.2.1 | 173 | 10/29/2026 |
| 0.2.0 | 247 | 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 |