Package selection guidance compiled from public package information, community data, and project usage.
FFmpeg Kit for Flutter provides full GPL-compliant FFmpeg bindings with updated functionality, enabling powerful video and audio processing across Android, iOS, and macOS. It allows developers to execute FFmpeg commands directly within Flutter apps, supporting tasks like format conversion, trimming, merging, and streaming. The package is actively maintained and integrates seamlessly with Flutter's ecosystem. Its robust cross-platform support makes it ideal for multimedia applications requiring advanced media manipulation.
There are eightffmpeg-kit packages — pick the smallest one that covers the codecs and features you need. GPL-licensed codecs (x264, x265, xvidcore, vid.stab) are only in the -gpl packages.
Windows: prebuilt FFmpeg 8.1.2 libraries (x86_64) are downloaded automatically at build time. For local development against a self-built bundle, set FFMPEGKIT_LOCAL_DIR (env or CMake cache variable) to the bundle directory before flutter run/build windows.
Linux: prebuilt FFmpeg 8.1.2 libraries (x86_64) are downloaded automatically at build time, exactly as on Windows; FFMPEGKIT_LOCAL_DIR works the same way. In addition to Flutter's standard Linux prerequisites (clang, cmake, ninja-build, pkg-config, libgtk-3-dev), the plugin needs libjson-glib-dev:
FFmpegKit.execute('-i file1.mp4 -c:v mpeg4 file2.mp4').then((session) async {
final sessionId = session.getSessionId();
final command = session.getCommand();
final state = await session.getState();
final returnCode = await session.getReturnCode();
final duration = await session.getDuration();
final output = await session.getOutput();
final logs = await session.getLogs();
final statistics = await (session asFFmpegSession).getStatistics();
});
Async execution with callbacks
FFmpegKit.executeAsync('-i file1.mp4 -c:v mpeg4 file2.mp4', (Session session) async {
// CALLED WHEN SESSION IS EXECUTED
}, (Log log) {
// CALLED WHEN SESSION PRINTS LOGS
}, (Statistics statistics) {
// CALLED WHEN SESSION GENERATES STATISTICS
});
FFprobe & media information
FFprobeKit.getMediaInformation('<file path or url>').then((session) async {
final information = await session.getMediaInformation();
});
Cancel sessions
FFmpegKit.cancel(); // stop all sessionsFFmpegKit.cancel(sessionId); // stop a specific session
Android — Storage Access Framework (SAF)
// Reading a fileFFmpegKitConfig.selectDocumentForRead('*/*').then((uri) {
FFmpegKitConfig.getSafParameterForRead(uri!).then((safUrl) {
FFmpegKit.executeAsync("-i ${safUrl!} -c:v mpeg4 file2.mp4");
});
});
// Writing to a fileFFmpegKitConfig.selectDocumentForWrite('video.mp4', 'video/*').then((uri) {
FFmpegKitConfig.getSafParameterForWrite(uri!).then((safUrl) {
FFmpegKit.executeAsync("-i file1.mp4 -c:v mpeg4 ${safUrl}");
});
});
Global callbacks & fonts
FFmpegKitConfig.enableLogCallback((log) { final message = log.getMessage(); });
FFmpegKitConfig.enableStatisticsCallback((statistics) { final size = statistics.getSize(); });
FFmpegKitConfig.setFontDirectoryList(["/system/fonts", "/System/Library/Fonts", "<folder with fonts>"]);
📄 License
Licensed under LGPL 3.0 by default. This package additionally includes GPL v3.0-licensed components (x264, x265, xvidcore, vid.stab) and is therefore effectively GPL v3.0.