When the maintainers of ffmpeg-kit
announced its deprecation, many Flutter developers were left wondering how to continue using it, especially when customizations like full-gpl
builds were needed.
If you’re working on Flutter apps for iOS and need a local build of ffmpeg-kit
, this guide walks you through compiling it on a Mac, solving common build errors along the way.
Let’s dive right in.
Step 1 — Install Required Build Tools for Flutter + iOS
First, ensure you have the necessary tools installed on your Mac:
brew install pkg-config meson autogen libtool nasm automake autoconf gtk-doc
xcode-select --install
sudo xcodebuild -license accept
🎯 These are critical for both Flutter plugin development and building native libraries like FFmpegKit.
Step 2 — Clone the FFmpegKit Repository for Your Flutter Plugin
Inside your Flutter project (or any workspace), create a plugin
folder and clone the repository:
mkdir plugin
cd plugin
git clone https://github.com/arthenica/ffmpeg-kit.git
This sets up the ffmpeg-kit
source code locally for building.
Step 3 — Build the FFmpegKit Full-GPL Version for iOS
Navigate into the cloned folder and start the build process:
cd ffmpeg-kit
./ios.sh --full --enable-gpl --target=12.1 --xcframework --disable-armv7 --disable-armv7s --disable-i386 --disable-lib-gnutls
✅ This generates an
.xcframework
ready to be used as a Flutter plugin dependency.
After running the script, the compiled frameworks will be generated under:
prebuilt/bundle-apple-framework-ios
Once the process is complete, make sure to check the build.log
file — it should not contain any errors.
Step 4 — Integrate FFmpegKit Frameworks into Your Flutter iOS Project
Now it’s time to connect the compiled FFmpegKit frameworks with your Flutter iOS app.
4.1 Copy the Generated Frameworks
mkdir -p flutter/flutter/ios/Frameworks
cp -r prebuilt/bundle-apple-framework-ios/* flutter/flutter/ios/Frameworks/
This copies the .xcframework
files into your Flutter plugin’s ios/Frameworks
directory.
4.2 Update the ffmpeg_kit_flutter.podspec
File
Next, open ffmpeg-kit/flutter/flutter/ios/ffmpeg_kit_flutter.podspec
and update it:
- Change the default subspec:
# Change from 'https' to your custom precompiled spec name
s.default_subspec = 'precompiled-gpl'
- Add the new subspec section:
s.subspec 'precompiled-gpl' do |ss|
ss.vendored_frameworks = 'Frameworks/ffmpegkit.xcframework',
'Frameworks/libavcodec.xcframework',
'Frameworks/libavdevice.xcframework',
'Frameworks/libavfilter.xcframework',
'Frameworks/libavformat.xcframework',
'Frameworks/libavutil.xcframework',
'Frameworks/libswresample.xcframework',
'Frameworks/libswscale.xcframework'
end
This tells CocoaPods to link your project against the locally built FFmpeg frameworks instead of downloading prebuilt binaries.
Troubleshooting FFmpegKit Build Issues on Mac for Flutter
Building ffmpeg-kit
isn’t always smooth. Here are the most frequent problems — and how to fix them.
Final Thoughts — Using Your Compiled FFmpegKit in a Flutter Project
Once you successfully compile the .xcframework
and configure your podspec
, you’ll have a fully working, license-compliant FFmpegKit build tailored for Flutter on iOS.
By doing it yourself, you gain:
- Full control over FFmpeg’s build options
- Ability to enable GPL libraries (e.g., x264, libfdk-aac)
- Freedom from relying on outdated prebuilt binaries
Happy building! 🚀
👉 Need more help? Check out the official troubleshooting page.