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
<PackageReference Include="MxPlot.UI.Avalonia.Video" Version="0.4.0" />
<PackageVersion Include="MxPlot.UI.Avalonia.Video" Version="0.4.0" />
<PackageReference Include="MxPlot.UI.Avalonia.Video" />
paket add MxPlot.UI.Avalonia.Video --version 0.4.0
#r "nuget: MxPlot.UI.Avalonia.Video, 0.4.0"
#:package MxPlot.UI.Avalonia.Video@0.4.0
#addin nuget:?package=MxPlot.UI.Avalonia.Video&version=0.4.0
#tool nuget:?package=MxPlot.UI.Avalonia.Video&version=0.4.0
MxPlot.UI.Avalonia.Video
Video export plugins for MxPlot, and a small framework for writing more
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 error0xC00D36B1(MF_E_UNSUPPORTED_FORMAT) in Windows Media Foundation (Media Player, PowerPoint, etc.).Mp4Exporter— H.264 MP4 by piping raw frames into an externalffmpegprocess. Plays natively on Windows and macOS (QuickTime included), unlike uncompressed AVI. RequiresffmpegonPATH; checkMp4Exporter.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
AviExporteronly) ffmpeg— external, user-installed, not bundled; only needed to useMp4Exporter
License
MIT License
| Product | Versions 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. |
-
net10.0
- MxPlot.UI.Avalonia (>= 0.4.0)
- SharpAvi (>= 3.0.1)
-
net8.0
- MxPlot.UI.Avalonia (>= 0.4.0)
- SharpAvi (>= 3.0.1)
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.