Aus öffentlichen Paketdaten erstellte Orientierung.
FFmpeg Kit für Flutter bietet vollständige GPL-kompatible FFmpeg-Bindings mit aktualisierten Funktionen und ermöglicht leistungsstarkes Video- und Audio-Processing auf Android, iOS und macOS. Es erlaubt Entwicklern, FFmpeg-Befehle direkt innerhalb von Flutter-Anwendungen auszuführen und unterstützt Aufgaben wie Formatkonvertierung, Ausschneiden, Zusammenfügen und Streaming. Das Paket wird aktiv gepflegt und nahtlos in die Flutter-Ecosystem integriert. Sein robuster Cross-Platform-Support macht es ideal für Multimedia-Anwendungen, die fortgeschrittene Medienmanipulation erfordern.
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.