Flutter용 FFmpeg Kit는 완전한 GPL 호환 FFmpeg 바인딩을 제공하며, 업데이트된 기능을 통해 Android, iOS 및 macOS에서 강력한 비디오 및 오디오 처리를 가능하게 합니다. 개발자는 Flutter 앱 내에서 직접 FFmpeg 명령어를 실행할 수 있으며, 포맷 변환, 자르기, 병합, 스트리밍 등의 작업을 지원합니다. 이 패키지는 적극적으로 유지 관리되며 Flutter 생태계와 원활하게 통합됩니다. 강력한 크로스플랫폼 지원으로 고급 미디어 조작이 필요한 멀티미디어 애플리케이션에 이상적입니다.
사용 사례
비디오 형식 변환
오디오 추출 및 편집
비디오 자르기 및 병합
라이브 스트리밍 처리
미디어 파일 분석
주요 기능
완전한 FFmpeg 명령어 지원
크로스 플랫폼 호환성 (Android, iOS, macOS)
업데이트된 바인딩과 함께한 GPL 준수
효율적인 미디어 처리
내장된 진행 및 오류 콜백
적합한 대상
멀티미디어 앱
비디오 편집 도구
스트리밍 애플리케이션
미디어 변환기
콘텐츠 관리 시스템
고려 사항
FFmpeg 바이너리로 인한 앱 크기 증가
FFmpeg CLI에 대한 이해가 필요합니다
GPL과 관련된 잠재적인 라이선스 문제
성능은 기기 하드웨어에 따라 달라집니다
복잡한 작업은 최적화가 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
🎬 FFmpegKit for Flutter — Full-GPL
Run FFmpeg & FFprobe on Android, iOS, macOS, Windows and Linux from a single Dart API.
A maintained fork of the original FFmpegKit, updated for the Android V2 embedding and Flutter 3+.
✨ Features
🧰 Full toolkit — both FFmpeg and FFprobe, with per-session logs, statistics and callbacks.
📱 Five platforms — Android, iOS, macOS, Windows (x86_64), and Linux (x86_64) behind one API.
🎞️ FFmpeg v8.1.2 with VideoToolbox hardware acceleration on iOS & macOS.
🗂️ Android SAF — process Storage Access Framework URIs directly.
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.