![]() |
VOOZH | about |
dotnet add package FFMpegCore --version 5.4.0
NuGet\Install-Package FFMpegCore -Version 5.4.0
<PackageReference Include="FFMpegCore" Version="5.4.0" />
<PackageVersion Include="FFMpegCore" Version="5.4.0" />Directory.Packages.props
<PackageReference Include="FFMpegCore" />Project file
paket add FFMpegCore --version 5.4.0
#r "nuget: FFMpegCore, 5.4.0"
#:package FFMpegCore@5.4.0
#addin nuget:?package=FFMpegCore&version=5.4.0Install as a Cake Addin
#tool nuget:?package=FFMpegCore&version=5.4.0Install as a Cake Tool
👁 NuGet Version
👁 GitHub issues
👁 GitHub stars
👁 GitHub
👁 codecov
👁 CI
👁 GitHub code contributors
A .NET Standard FFMpeg/FFProbe wrapper for easily integrating media analysis and conversion into your .NET applications. Supports both synchronous and asynchronous calls
Use FFProbe to analyze media files:
var mediaInfo = await FFProbe.AnalyseAsync(inputPath);
or
var mediaInfo = FFProbe.Analyse(inputPath);
Use FFMpeg to convert your media files. Easily build your FFMpeg arguments using the fluent argument builder:
Convert input file to h264/aac scaled to 720p w/ faststart, for web playback
FFMpegArguments
.FromFileInput(inputPath)
.OutputToFile(outputPath, false, options => options
.WithVideoCodec(VideoCodec.LibX264)
.WithConstantRateFactor(21)
.WithAudioCodec(AudioCodec.Aac)
.WithVariableBitrate(4)
.WithVideoFilters(filterOptions => filterOptions
.Scale(VideoSize.Hd))
.WithFastStart())
.ProcessSynchronously();
Convert to and/or from streams
await FFMpegArguments
.FromPipeInput(new StreamPipeSource(inputStream))
.OutputToPipe(new StreamPipeSink(outputStream), options => options
.WithVideoCodec("vp9")
.ForceFormat("webm"))
.ProcessAsynchronously();
The provided helper methods makes it simple to perform common operations.
// process the snapshot in-memory and use the Bitmap directly
var bitmap = FFMpeg.Snapshot(inputPath, new Size(200, 400), TimeSpan.FromMinutes(1));
// or persists the image on the drive
FFMpeg.Snapshot(inputPath, outputPath, new Size(200, 400), TimeSpan.FromMinutes(1));
FFMpeg.GifSnapshot(inputPath, outputPath, new Size(200, 400), TimeSpan.FromSeconds(10));
// or async
await FFMpeg.GifSnapshotAsync(inputPath, outputPath, new Size(200, 400), TimeSpan.FromSeconds(10));
// you can also supply -1 to either one of Width/Height Size properties if you'd like FFMPEG to resize while maintaining the aspect ratio
await FFMpeg.GifSnapshotAsync(inputPath, outputPath, new Size(480, -1), TimeSpan.FromSeconds(10));
FFMpeg.Join(@"..\joined_video.mp4",
@"..\part1.mp4",
@"..\part2.mp4",
@"..\part3.mp4"
);
FFMpeg.SubVideo(inputPath,
outputPath,
TimeSpan.FromSeconds(0),
TimeSpan.FromSeconds(30)
);
FFMpeg.JoinImageSequence(@"..\joined_video.mp4", frameRate: 1,
ImageInfo.FromPath(@"..\1.png"),
ImageInfo.FromPath(@"..\2.png"),
ImageInfo.FromPath(@"..\3.png")
);
FFMpeg.Mute(inputPath, outputPath);
FFMpeg.ExtractAudio(inputPath, outputPath);
FFMpeg.ReplaceAudio(inputPath, inputAudioPath, outputPath);
FFMpeg.PosterWithAudio(inputPath, inputAudioPath, outputPath);
// or
var image = Image.FromFile(inputImagePath);
image.AddAudio(inputAudioPath, outputPath);
Other available arguments could be found in FFMpegCore.Arguments namespace.
With input piping it is possible to write video frames directly from program memory without saving them to jpeg or png and then passing path to input of ffmpeg. This feature also allows for converting video on-the-fly while frames are being generated or received.
An object implementing the IPipeSource interface is used as the source of data. Currently, the IPipeSource interface has two
implementations; StreamPipeSource for streams, and RawVideoPipeSource for raw video frames.
Method for generating bitmap frames:
IEnumerable<IVideoFrame> CreateFrames(int count)
{
for(int i = 0; i < count; i++)
{
yield return GetNextFrame(); //method that generates of receives the next frame
}
}
Then create a RawVideoPipeSource that utilises your video frame source
var videoFramesSource = new RawVideoPipeSource(CreateFrames(64))
{
FrameRate = 30 //set source frame rate
};
await FFMpegArguments
.FromPipeInput(videoFramesSource)
.OutputToFile(outputPath, false, options => options
.WithVideoCodec(VideoCodec.LibVpx))
.ProcessAsynchronously();
If you want to use System.Drawing.Bitmaps as IVideoFrames, a BitmapVideoFrameWrapper wrapper class is provided.
You can install a version of ffmpeg suite at runtime using FFMpegDownloader.DownloadFFMpegSuite();
This feature uses the api from ffbinaries.
If you prefer to manually download them, visit ffbinaries or zeranoe Windows builds.
command: choco install ffmpeg -y
location: C:\ProgramData\chocolatey\lib\ffmpeg\tools\ffmpeg\bin
command: brew install ffmpeg mono-libgdiplus
location: /usr/local/bin
command: sudo apt-get install -y ffmpeg libgdiplus
location: /usr/bin
The default value of an empty string (expecting ffmpeg to be found through PATH) can be overwritten via the FFOptions class:
// setting global options
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "/tmp" });
// or
GlobalFFOptions.Configure(options => options.BinaryFolder = "./bin");
// on some systems the absolute path may be required, in which case
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = Server.MapPath("./bin"), TemporaryFilesFolder = Server.MapPath("/tmp") });
// or individual, per-run options
await FFMpegArguments
.FromFileInput(inputPath)
.OutputToFile(outputPath)
.ProcessAsynchronously(true, new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "/tmp" });
// or combined, setting global defaults and adapting per-run options
GlobalFFOptions.Configure(new FFOptions { BinaryFolder = "./bin", TemporaryFilesFolder = "./globalTmp", WorkingDirectory = "./" });
await FFMpegArguments
.FromFileInput(inputPath)
.OutputToFile(outputPath)
.Configure(options => options.WorkingDirectory = "./CurrentRunWorkingDir")
.Configure(options => options.TemporaryFilesFolder = "./CurrentRunTmpFolder")
.ProcessAsynchronously();
The root and temp directory for the ffmpeg binaries can be configured via the ffmpeg.config.json file, which will be read on first use
only.
{
"BinaryFolder": "./bin",
"TemporaryFilesFolder": "/tmp"
}
If you wish to support multiple client processor architectures, you can do so by creating two folders, x64 and x86, in the
BinaryFolder directory.
Both folders should contain the binaries (ffmpeg.exe and ffprobe.exe) built for the respective architectures.
By doing so, the library will attempt to use either /{BinaryFolder}/{ARCH}/(ffmpeg|ffprobe).exe.
If these folders are not defined, it will try to find the binaries in /{BinaryFolder}/(ffmpeg|ffprobe.exe).
(.exe is only appended on Windows)
Older versions of ffmpeg might not support all ffmpeg arguments available through this library. The library has been tested with version
3.3 to 4.2
<a href="https://github.com/rosenbjerg/ffmpegcore/graphs/contributors"> <img src="https://contrib.rocks/image?repo=rosenbjerg/ffmpegcore" /> </a>
<a href="https://github.com/tiesont"><img src="https://avatars3.githubusercontent.com/u/420293?v=4" title="tiesont" width="80" height="80"></a>
Copyright © 2023
Released under MIT license
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on FFMpegCore:
| Package | Downloads |
|---|---|
|
SIL.Media
SIL.Media contains Windows Forms UI elements and classes for processing audio on Windows and Linux. |
|
|
Fsel.Core
Fsel Core Package |
|
|
JXIPS.Infrastructure
基础设施层 |
|
|
FFMpegCore.Extensions.System.Drawing.Common
Image extension for FFMpegCore using System.Common.Drawing |
|
|
StaticSharp.Core
Package Description |
Showing the top 20 popular GitHub repositories that depend on FFMpegCore:
| Repository | Stars |
|---|---|
|
PixiEditor/PixiEditor
PixiEditor is a Universal Editor for all your 2D needs
|
|
|
yaobiao131/downkyicore
哔哩下载姬(跨平台版)downkyi,哔哩哔哩网站视频下载工具,支持批量下载,支持8K、HDR、杜比视界,提供工具箱(音视频提取、去水印等)。
|
|
|
Squidex/squidex
Headless CMS and Content Managment Hub
|
|
|
xiaoyaocz/biliuwp-lite
哔哩哔哩UWP Lite
|
|
|
swharden/Csharp-Data-Visualization
Resources for visualizing data using C# and the .NET platform
|
|
|
trueai-org/midjourney-proxy
🦄 The world's largest Midjourney drawing API, generating over 1 million drawings daily, supporting Discord Youchuan Midjourney 🐂!
|
|
|
dorisoy/Dorisoy.Pan
Dorisoy.Pan 是基于 .NET 10 的跨平台文档管理系统,使用 MS SQL 2012 / MySQL 8.0(或更高版本)后端数据库,您可以在 Windows、Linux 或 Mac 上运行它。项目中的所有方法都是异步的,支持 JWT 令牌身份验证,项目体系结构遵循 CQRS + MediatR 模式和最佳安全实践。源代码完全可定制,热插拔且清晰的体系结构,使开发定制功能和遵循任何业务需求变得容易。
|
|
|
ww-rm/SpineViewer
一个简单好用的 spine 文件查看&导出&壁纸工具。A simple and easy-to-use spine file viewer & exporter & wallpaper.
|
|
|
h4lfheart/FortnitePorting
The quickest and most efficient way to extract assets from Fortnite
|
|
|
withsalt/BilibiliLiveTools
Bilibili(B站)无人值守直播工具。自动登录,自动获取直播推流地址,自动推流(使用ffmpeg),可以用于电脑、树莓派等设备无人值守直播。
|
|
|
ncatlin/rgat
An instruction trace visualisation tool for dynamic program analysis
|
|
|
kabiiQ/BeatmapExporter
osu! Lazer file exporter utility. Enables mass export of beatmaps from the new osu! Lazer file storage back into .osz files, in addition to replays, skins, and collections.
|
|
|
onionware-github/OnionMedia
Open-Source Mediaconverter and -downloader
|
|
|
8212369/WPR
WP7-8 APP 运行器
|
|
|
f-shake/RemoteFFmpegGUI
使用 Vue.js + ASP.NET + WPF 搭建的 FFmpeg 的 Web + Windows GUI 应用,支持视频转码、拼接等功能
|
|
|
Forgot-Dream/STS-Bcut
使用必剪API,语音转字幕,支持输入声音文件,也支持输入视频文件自动提取音频。
|
|
| Kuschel-code/JellyfinUpscalerPlugin | |
|
WhiskeySockets/BaileysCSharp
Lightweight full-featured C# WhatsApp Web API
|
|
|
v0l/void.cat
Free file hosting website
|
|
|
HeBianGu/WPF-Control
WPF-Control 是一个基于 .NET 8+ 的高性能 WPF 控件库,提供丰富的轻量级 UI 组件、多套现代化 皮肤主题,并整合了精选的 第三方开源控件,同时内置 数据库仓储模型 和 模块化封装 的通用功能,包含完整桌面应用程序的解决方案,适用于企业级应用开发,帮助开发者快速构建高效、美观的桌面应用程序。
|
| Version | Downloads | Last Updated |
|---|---|---|
| 5.4.0 | 837,560 | 10/27/2025 |
| 5.3.0 | 38,444 | 10/17/2025 |
| 5.2.0 | 1,054,129 | 3/5/2025 |
| 5.1.0 | 2,993,947 | 3/15/2023 |
| 5.0.2 | 105,480 | 2/21/2023 |
| 5.0.1 | 4,552 | 2/16/2023 |
| 5.0.0 | 62,610 | 2/4/2023 |
| 4.8.0 | 422,565 | 4/15/2022 |
| 4.7.0 | 149,690 | 1/8/2022 |
| 4.6.0 | 115,791 | 11/1/2021 |
| 4.5.0 | 47,298 | 8/12/2021 |
| 4.4.0 | 21,319 | 7/15/2021 |
| 4.3.0 | 38,566 | 6/8/2021 |
| 4.2.0 | 19,254 | 5/14/2021 |
| 4.1.0 | 96,387 | 3/15/2021 |
| 4.0.0 | 14,150 | 3/6/2021 |
| 3.4.0 | 7,576 | 2/3/2021 |
| 3.3.0 | 9,397 | 12/19/2020 |
| 3.2.4 | 38,679 | 12/9/2020 |
| 3.2.3 | 1,876 | 12/9/2020 |
- Fixed exception thrown on cancelling ffprobe analysis - by snechaev
- Support for cancellationtoken in SnapsnotAsync methods - by snechaev
- Added FFMetadataBuilder - by rosenbjerg
- Fix JoinImageSequence by passing framerate argument to input as well as output - by rosenbjerg
- Change fps input from int to double - by rosenbjerg
- Fix GetCreationTime method on ITagsContainer - by rosenbjerg