MxPlot.UI.Avalonia.Video 0.4.0

dotnet add package MxPlot.UI.Avalonia.Video --version 0.4.0
                    
NuGet\Install-Package MxPlot.UI.Avalonia.Video -Version 0.4.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="MxPlot.UI.Avalonia.Video" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MxPlot.UI.Avalonia.Video" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="MxPlot.UI.Avalonia.Video" />
                    
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 MxPlot.UI.Avalonia.Video --version 0.4.0
                    
#r "nuget: MxPlot.UI.Avalonia.Video, 0.4.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 MxPlot.UI.Avalonia.Video@0.4.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=MxPlot.UI.Avalonia.Video&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=MxPlot.UI.Avalonia.Video&version=0.4.0
                    
Install as a Cake Tool

MxPlot.UI.Avalonia.Video

Video export plugins for MxPlot, and a small framework for writing more

NuGet .NET License

MxPlot.UI.Avalonia.Video provides frame-sequence video export plugins for the MxPlot Avalonia UI (AviExporter, Mp4Exporter), plus VideoExporterBase/IVideoFrameWriter -- the reusable base those two are themselves built on -- for adding further formats without reimplementing the settings dialog or frame-rendering loop.

Included exporters

  • AviExporter — uncompressed 24-bit BGR AVI via SharpAvi. Plays natively on Windows (Media Foundation / Video for Windows). No external dependency. Correct DIB row padding: each BGR24 row is padded to a 4-byte boundary as required by the AVI/DIB spec -- without this, widths not divisible by 4 produce error 0xC00D36B1 (MF_E_UNSUPPORTED_FORMAT) in Windows Media Foundation (Media Player, PowerPoint, etc.).
  • Mp4Exporter — H.264 MP4 by piping raw frames into an external ffmpeg process. Plays natively on Windows and macOS (QuickTime included), unlike uncompressed AVI. Requires ffmpeg on PATH; check Mp4Exporter.IsFfmpegAvailable() before registering it, so the export menu never advertises a format that would just fail on a machine without ffmpeg installed:
    MatrixPlotterPluginRegistry.AddExportPlugin(new AviExporter());
    if (Mp4Exporter.IsFfmpegAvailable())
        MatrixPlotterPluginRegistry.AddExportPlugin(new Mp4Exporter());
    

Both share hyperstack support (choosing which axis — Channel, Z, Time, … — to iterate when exporting multi-dimensional data) via the same VideoExportDialog.

Writing a new format: VideoExporterBase + IVideoFrameWriter

Every frame-sequence video export needs the same settings (animation axis, interval/fps, output size, overlay toggle) and the same render-frame-then-write loop; only how a frame gets written to the target container/codec actually differs. VideoExporterBase (implements IRenderExportPlugin) owns the former; you only supply the latter via IVideoFrameWriter:

public sealed class MyFormatExporter : VideoExporterBase
{
    public override string Label => "MyFormat…";
    public override string Hint => "Exports the frames as MyFormat";
    public override string FileTypeName => "MyFormat Video";
    public override string FilePattern => "*.myf";

    protected override string FormatLabel => "MyFormat";       // used in the dialog's title
    protected override bool SizeEstimateIsExact => false;      // false for anything compressed

    protected override IVideoFrameWriter CreateWriter(string path, int width, int height, decimal fps)
        => new MyFormatFrameWriter(path, width, height, fps);
}

public sealed class MyFormatFrameWriter : IVideoFrameWriter
{
    public void WriteFrame(byte[] bgra, int width, int height) { /* bgra is top-down BGRA32 */ }
    public void Finish() { /* called once, success path only, before Dispose */ }
    public void Dispose() { /* release resources regardless of outcome */ }
}

Register it the same way as the built-in exporters:

MatrixPlotterPluginRegistry.AddExportPlugin(new MyFormatExporter());

See AviExporter/AviFrameWriter (SharpAvi, in-process) and Mp4Exporter/FfmpegFrameWriter (external subprocess) for two working reference implementations with different shapes.

IRenderHost.RenderFrameAsync (what VideoExporterBase's frame loop calls on your behalf) is thread-safe and always returns top-down BGRA32; all UI-thread marshalling is handled internally by the host, so an IVideoFrameWriter only needs to worry about its own format's pixel layout (row order, padding, channel order) when converting from that.

Dependencies

  • SharpAvi — MIT license (used by AviExporter only)
  • ffmpeg — external, user-installed, not bundled; only needed to use Mp4Exporter

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 MxPlot.UI.Avalonia.Video:

Package Downloads
MxPlot

MxPlot: Multi-Axis Matrix Visualization Library for .NET. This project is currently under active development.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 63 9/12/2026
0.3.1 101 8/30/2026
0.2.0 124 8/6/2026