FFmpegVideoPlayer.Avalonia 3.0.0

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

NuGet License

FFmpegVideoPlayer.Avalonia

Standalone FFmpeg media player for Avalonia 12. It owns source resolution, streaming, playback lifecycle, cancellation and cleanup for local video/audio, HTTP media, seekable streams, DASH manifests and YouTube URLs.

Preview

Install

dotnet add package FFmpegVideoPlayer.Avalonia --version 3.0.0

Version 3 requires Avalonia 12.1.0+ (below 13) and .NET 8+. The single package contains the Avalonia control, Core and OpenTK/OpenAL audio implementation; applications do not reference separate player packages.

The managed player API is cross-platform, but the native payload is platform-specific: FFmpeg 8.0.1 DLLs are bundled only for Windows x64. Windows x86/ARM64, macOS, and Linux require a compatible system FFmpeg installation or an explicitly supplied native-library path. OpenAL Soft audio DLLs are bundled separately for Windows x64, x86, and ARM64.

Quick start

1. Initialize FFmpeg (e.g. in Program.cs before the app starts):

using FFmpegVideoPlayer.Core;

FFmpegInitializer.Initialize();

2. Add the control in XAML:

xmlns:ffmpeg="clr-namespace:Avalonia.FFmpegVideoPlayer;assembly=Avalonia.FFmpegVideoPlayer"

<ffmpeg:VideoPlayerControl Source="C:\path\to\video.mp4" ShowControls="True" />

Video and audio-only files are both supported, for example .mp4, .mov, .mp3, .wav, .flac, .ogg, and .m4a.

Source also accepts direct HTTP(S) and YouTube URLs. Source changes are resolved asynchronously and stale opens are cancelled automatically:

<ffmpeg:VideoPlayerControl
    Source="https://youtu.be/Ppejf4-YmSM"
    AutoPlay="True"
    ShowOpenButton="False" />

For custom headers, in-memory media or manifests, use the typed API:

var source = MediaSource.FromUri(
    new Uri("https://media.example/video.mp4"),
    headers: new Dictionary<string, string> { ["Authorization"] = "Bearer …" });

var result = await player.OpenAsync(
    source,
    new MediaOpenOptions
    {
        OpenTimeout = TimeSpan.FromSeconds(20),
        ReadTimeout = TimeSpan.FromSeconds(30)
    },
    cancellationToken);

OpenAL Soft binaries for Windows x64, x86 and ARM64 are included in the package.

FFmpeg

Platform Default
Windows x64 Bundled DLLs in the package
Windows x86 / ARM64 Compatible system FFmpeg 8 native libraries or a custom path
macOS (x64 / ARM64) System/Homebrew (brew install ffmpeg); can auto-install
Linux (x64 / ARM64) System packages (apt/dnf/pacman); can auto-install with passwordless sudo

On every row except Windows x64, FFmpeg is a system/native prerequisite; it is not contained in the NuGet package. Automatic installation, where supported, installs that system prerequisite. The required FFmpeg 8 library ABI is avcodec-62, avformat-62, avutil-60, swresample-6, and swscale-9.

Custom FFmpeg path:

FFmpegInitializer.Initialize(customPath: @"C:\ffmpeg\bin", useBundledBinaries: false);

Subscribe to StatusChanged for progress during discovery or auto-install.

Example

git clone https://github.com/jojomondag/FFmpegVideoPlayer.Avalonia.git
cd FFmpegVideoPlayer.Avalonia/examples/FFmpegVideoPlayerExample
dotnet run

VideoPlayerControl

Sources: Source for a path/URL, or typed Media for reusable MediaSource recipes.

Lifecycle: PlaybackState, LastError, MediaOpening, MediaOpened, MediaFailed, PlaybackStateChanged, and MediaEnded.

Methods: OpenAsync, Open, OpenUri, CloseAsync, Play, Pause, Stop, TogglePlayPause, Seek, and ToggleMute.

Presentation: AutoPlay, Volume, ShowControls, ShowOpenButton, VideoStretch, VideoBackground, EnableKeyboardShortcuts, RenderingMode (Cpu / OpenGL), AudioPlayerFactory, and IconProvider.

Shortcuts: Space (play/pause), arrow keys (seek/volume), M (mute)

Set AudioPlayerFactory to customize or disable audio. OpenAL via OpenTK is the default.

Custom icons: implement IIconProvider and set IconProvider.

License

The managed project code is licensed under MIT. The NuGet package also redistributes FFmpeg and OpenAL Soft native libraries under their respective GNU LGPL terms. See THIRD-PARTY-NOTICES.md for provenance, checksums, source availability, replacement rights, and the packaged license-text locations.

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 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 52 7/17/2026
2.9.0 183 5/29/2026
2.8.1 143 5/20/2026
2.8.0 187 4/24/2026
2.7.1 117 4/24/2026
2.7.0 106 4/24/2026
2.6.3 255 3/31/2026
2.6.2 121 3/31/2026
2.6.1 129 3/25/2026
2.6.0 114 3/25/2026
2.5.8 116 3/25/2026
2.5.7 117 3/25/2026
2.5.6 117 3/25/2026
2.5.5 112 3/25/2026
2.5.4 123 3/25/2026
2.5.3 109 3/25/2026
2.5.2 122 3/25/2026
2.5.1 110 3/25/2026
2.5.0 110 3/25/2026
2.4.3 114 3/25/2026
Loading failed

v3.0.0: Targets Avalonia 12.1, ships as one standalone package, adds typed and asynchronous media sources, built-in YouTube resolution, bounded/cancellable network I/O, lifecycle state, and structured media errors.