flutter_ffmpeg 0.1.0
flutter_ffmpeg: ^0.1.0 copied to clipboard
FFmpeg plugin for Flutter.
flutter_ffmpeg #
FFmpeg plugin for Flutter. Supports iOS and Android.
1. Features #
-
Based on MobileFFmpeg
-
Supports
-
Both Android and IOS
-
FFmpeg
v4.2-dev-x(master) releases -
arm-v7a,arm-v7a-neon,arm64-v8a,x86andx86_64architectures on Android -
armv7,armv7s,arm64,arm64e,i386andx86_64architectures on IOS -
24 external libraries
fontconfig,freetype,fribidi,gmp,gnutls,kvazaar,lame,libaom,libass,libiconv,libilbc,libtheora,libvorbis,libvpx,libwebp,libxml2,opencore-amr,opus,shine,snappy,soxr,speex,twolame,wavpack -
4 external libraries with GPL license
vid.stab,x264,x265,xvidcore -
zlibandMediaCodecAndroid system libraries -
bzip2,zlibIOS system libraries andAudioToolbox,CoreImage,VideoToolbox,AVFoundationIOS system frameworks
-
-
Licensed under LGPL 3.0, can be customized to support GPL v3.0
-
Includes eight different packages with different external libraries enabled in FFmpeg
| min | min-gpl | https | https-gpl | audio | video | full | full-gpl | |
|---|---|---|---|---|---|---|---|---|
| external libraries | - | vid.stab x264 x265 xvidcore |
gmp gnutls |
gmp gnutls vid.stab x264 x265 xvidcore |
lame libilbc libvorbis opencore-amr opus shine soxr speex twolame wavpack |
fontconfig freetype fribidi kvazaar libaom libass libiconv libtheora libvpx libwebp snappy |
fontconfig freetype fribidi gmp gnutls kvazaar lame libaom libass libiconv libilbc libtheora libvorbis libvpx libwebp libxml2 opencore-amr opus shine snappy soxr speex twolame wavpack |
fontconfig freetype fribidi gmp gnutls kvazaar lame libaom libass libiconv libilbc libtheora libvorbis libvpx libwebp libxml2 opencore-amr opus shine snappy soxr speex twolame vid.stab wavpack x264 x265 xvidcore |
| android system libraries | zlib MediaCodec |
|||||||
| ios system libraries | zlib AudioToolbox AVFoundation CoreImage VideoToolbox bzip2 |
|||||||
2. Installation #
Add flutter_ffmpeg as a dependency in your pubspec.yaml file.
2.1 Packages
Default installation of FlutterFFmpeg enables the default package, which is based on https package. It is possible
to enable other installed packages using the following steps.
-
Use the following dependency block in your
pubspec.yamlfile.dependencies: flutter_ffmpeg: git: url: git://github.com/tanersener/flutter-ffmpeg.git ref: v0.1.0 path: packages/flutter_ffmpeg_https -
Set package name in
path: packages/flutter_ffmpeg_<package name>section.
3. Using #
-
Execute commands.
import 'package:flutter_ffmpeg/flutter_ffmpeg.dart'; final FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg(); _flutterFFmpeg.execute("-i file1.mp4 -c:v mpeg4 file2.mp4").then((rc) => print("FFmpeg process exited with rc $rc")); -
Check execution output.
_flutterFFmpeg.getLastReturnCode().then((rc) => print("Last rc: $rc")); _flutterFFmpeg.getLastCommandOutput().then((output) => print("Last command output: $output")); -
Stop an ongoing operation.
_flutterFFmpeg.cancel(); -
Get media information for a file.
_flutterFFmpeg.getMediaInformation('<file path or uri>').then((info) => print(info)); -
List enabled external libraries.
_flutterFFmpeg.getExternalLibraries().then((packageList) { packageList.forEach((value) => print("External library: $value")); }); -
Enable log callback.
void logCallback(int level, String message) { print(message); } ... _flutterFFmpeg.enableLogCallback(this.logCallback); -
Enable statistics callback.
void statisticsCallback(int time, int size, double bitrate, double speed, int videoFrameNumber, double videoQuality, double videoFps) { print("Statistics: time: $time, size: $size, bitrate: $bitrate, speed: $speed, videoFrameNumber: $videoFrameNumber, videoQuality: $videoQuality, videoFps: $videoFps"); } ... _flutterFFmpeg.enableStatisticsCallback(this.statisticsCallback); -
Get last received statistics.
_flutterFFmpeg.getLastReceivedStatistics().then((stats) => print(stats)); -
Set log level.
_flutterFFmpeg.setLogLevel(LogLevel.AV_LOG_WARNING); -
Register custom fonts directory.
_flutterFFmpeg.setFontDirectory("<folder with fonts>");
4. Versions #
4.1 Releases
0.1.0releases is based onFFmpeg v4.2-devandMobileFFmpeg v4.2.LTS
5. Updates #
Refer to Changelog for updates.
6. License #
This project is licensed under the LGPL v3.0. However, if installation is customized to use a package with -gpl postfix (min-gpl, https-gpl, full-gpl) then FlutterFFmpeg is subject to the GPL v3.0 license.
Digital assets used in test applications are published in the public domain.
7. Contributing #
Feel free to submit issues or pull requests.