Xamarin.Android bindings of FFmpegKit
Install the package via NuGet. There are various packages depending on what you plan to use and if you require a GPL compatible package or not. These package variants match the different variants built in the FFmpegKit repository.
Include Ffmpegkit.Droid
namespace
using Ffmpegkit.Droid;
Execute your FFmpeg command
FFmpegKit.Execute("-i input.mov -c:v libx264 output.mp4");
More examples and usage can be found in the FFmpegKit wiki.
- Navigate to the Jars directory in terminal
- Run FetchJars.sh
$ ./FetchJars.sh
- Go back up one directory
- Run BuildNugets.sh
$ ./BuildNugets.sh
- This will now create nupkg packages of all 8 variants of FFmpegKit.Android.
Tip: If you only want to build one variant of FFmpegKit.Android and its nuget packages, comment out other lines in FetchJars.sh
and BuildNugets.sh
.
- Download
smart-exception-common-0.2.1.jar
andsmart-exception-java-0.2.1.jar
from the smart-exception repository. - Place in
Jars
folder. - Download
ffmpeg-kit-audio-5.1.LTS.aar
,ffmpeg-kit-full-5.1.LTS.aar
,ffmpeg-kit-full-gpl-5.1.LTS.aar
,ffmpeg-kit-https-5.1.LTS.aar
,ffmpeg-kit-https-gpl-5.1.LTS.aar
,ffmpeg-kit-min-5.1.LTS.aar
,ffmpeg-kit-min-gpl-5.1.LTS.aar
andffmpeg-kit-video-5.1.LTS.aar
from the FFmpegKit repository from the releases tab, under LTS build. NOTE: If you only intend to build one binding then you only need to download that one aar file. - Place in
Jars
folder. - In the directory relative to the csproj file run the build command
msbuild FFmpegKit.Android.csproj /p:Configuration=Release /p:FFmpegKitBuildType={TYPE} -target:Clean,Build
where {TYPE}
is the FFmpegKit variant you are building. Possible options are Audio
, Full
, FullGpl
, Https
, HttpsGpl
, Min
, MinGpl
or Video
.
- To build the nuget package run the pack command
nuget pack ../Nugets/Xamarin.FFmpegKit.{TYPE}.Android/Xamarin.FFmpegKit.{TYPE}.Android.nuspec -Symbols -SymbolPackageFormat snupkg
where type is the same as from the previous step.