-
Notifications
You must be signed in to change notification settings - Fork 0
Using FFmpegKit in Unity
-
Download the latest
ffmpeg-kit-<package>-<version>.aarfile from the Releases page and copy it under the<Your Unity Project Name>/Assets/Plugins/Androidfolder.- Please note that
Mainreleases support API Level 24 andLTSreleases support API Level 16.
- Please note that
-
FFmpegKitAndroid library depends on smart-exception library. It must be imported as well. Go to the Releases page, find the latest release, download thesmart-exception-common-a.b.c.jarandsmart-exception-java-a.b.c.jarfiles and copy them under the<Your Unity Project Name>/Assets/Plugins/Androidfolder. -
Disable the handling of
SIGXCPUsignal by running the following code block.AndroidJavaClass configClass = new AndroidJavaClass("com.arthenica.ffmpegkit.FFmpegKitConfig"); AndroidJavaObject paramVal = new AndroidJavaClass("com.arthenica.ffmpegkit.Signal").GetStatic<AndroidJavaObject>("SIGXCPU"); configClass.CallStatic("ignoreSignal", new object[] { paramVal });
-
Use the following code block to call
executemethod and runffmpegcommands.AndroidJavaClass javaClass = new AndroidJavaClass("com.arthenica.ffmpegkit.FFmpegKit"); AndroidJavaObject session = javaClass.CallStatic<AndroidJavaObject>("execute", new object[] {"-version"}); AndroidJavaObject returnCode = session.Call<AndroidJavaObject>("getReturnCode", new object[] {}); int rc = returnCode.Call<int>("getValue", new object[] {});
-
You can call other
ffmpeg-kitAPI methods using a similar approach.string output = session.Call<string>("getOutput", new object[] {}); Debug.Log("Output " + output);
Unity Cloud Build does support importing Xcode frameworks. So it should be possible to import ffmpeg-kit frameworks using the Xcode frameworks guide. Unfortunately, it is not tested and documented yet.
There are unofficial blogs about using Cocoapods under Unity. If you can make them work then you can import ffmpeg-kit by adding ffmpeg-kit dependency into your Podfile as described in README.
Copyright (c) 2021-2025 FFmpegKit
- Status
- Versions
- Changelog
- Project Layout
- API
- Using
- Building
- External Libraries
- Patents
- License