flutter_ffmpeg 0.2.10

  • Readme
  • Changelog
  • Example
  • Installing
  • 96

flutter_ffmpeg #

GitHub release

FFmpeg plugin for Flutter. Supports iOS and Android.

1. Features #

  • Based on MobileFFmpeg

  • Includes both FFmpeg and FFprobe

  • Supports

    • Both Android and iOS

    • Both Android (API Level 16+) and iOS (SDK 9.3+)

    • FFmpeg v4.1, v4.2 and v4.3-dev releases

    • arm-v7a, arm-v7a-neon, arm64-v8a, x86 and x86_64 architectures on Android

    • armv7, armv7s, arm64, arm64e, i386 and x86_64 architectures 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

    • Concurrent execution

    • zlib and MediaCodec Android system libraries

    • bzip2, zlib, iconv iOS system libraries and AudioToolbox, CoreImage, VideoToolbox, AVFoundation iOS 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
iconv
VideoToolbox
bzip2

2. Installation #

Add flutter_ffmpeg as a dependency in your pubspec.yaml file.

dependencies:
    flutter_ffmpeg: ^0.2.10

2.1 Packages

Installation of FlutterFFmpeg using pub enables the default package, which is based on https package. It is possible to enable other packages using the following steps.

2.1.1 Android
  • Edit android/build.gradle file and define package name in ext.flutterFFmpegPackage variable.

      ext {
          flutterFFmpegPackage  = "<package name>"
      }
    
    
2.1.2 iOS
  • Edit ios/Podfile file and modify the default # Plugin Pods block as follows. Do not forget to specify package name in <package name> section.

      # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
      # referring to absolute paths on developers' machines.
      system('rm -rf .symlinks')
      system('mkdir -p .symlinks/plugins')
      plugin_pods = parse_KV_file('../.flutter-plugins')
      plugin_pods.each do |name, path|
        symlink = File.join('.symlinks', 'plugins', name)
        File.symlink(path, symlink)
        if name == 'flutter_ffmpeg'
            pod name+'/<package name>', :path => File.join(symlink, 'ios')
        else
            pod name, :path => File.join(symlink, 'ios')
        end
      end
    
2.1.3 Package Names

The following table shows all package names defined for flutter_ffmpeg.

PackageMain ReleaseLTS Release
minminmin-lts
min-gplmin-gplmin-gpl-lts
httpshttpshttps-lts
https-gplhttps-gplhttps-gpl-lts
audioaudioaudio-lts
videovideovideo-lts
fullfullfull-lts
full-gplfull-gplfull-gpl-lts

2.2 Existing Applications

It is possible to add flutter_ffmpeg to existing applications using Add-to-App guide.

Please execute the following additional steps if you are integrating into an iOS application.

  1. Go to Build Phases of Pods -> FlutterPluginRegistrant target and add all frameworks under the Pods/mobile-ffmpeg-<package name> directory to the Link Binary With Libraries section

  2. Go to Build Phases of Pods -> FlutterPluginRegistrant target and add all system libraries/frameworks listed in Step 4 of Importing-Frameworks guide to the Link Binary With Libraries section

  3. Go to Build Phases of Pods -> FlutterPluginRegistrant target and add AVFoundation system framework to the Link Binary With Libraries section

2.3 LTS Releases

flutter_ffmpeg is published in two different variants: Main Release and LTS Release. Both releases share the same source code but is built with different settings. Below you can see the changes between the two.

In order to install the LTS variant, install the https-lts package using instructions in 2.1 or append -lts to the package name you are using.

Main Release LTS Release
Android API Level 24 16
Android Camera Access Yes -
Android Architectures arm-v7a-neon
arm64-v8a
x86
x86-64
arm-v7a
arm-v7a-neon
arm64-v8a
x86
x86-64
Xcode Support 10.1 7.3.1
iOS SDK 12.1 9.3
iOS Architectures arm64
arm64e
x86-64
armv7
arm64
i386
x86-64

3. Using #

  1. Execute FFmpeg commands.

    • Use execute() method with a single command line
     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"));
    
    • Use executeWithArguments() method with an array of arguments
     import 'package:flutter_ffmpeg/flutter_ffmpeg.dart';
    
     final FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg();
    
     var arguments = ["-i", "file1.mp4", "-c:v", "mpeg4", "file2.mp4"];
     _flutterFFmpeg.executeWithArguments(arguments).then((rc) => print("FFmpeg process exited with rc $rc"));
    
  2. Execute FFprobe commands.

    • Use execute() method with a single command line
     import 'package:flutter_ffmpeg/flutter_ffmpeg.dart';
    
     final FlutterFFprobe _flutterFFprobe = new FlutterFFprobe();
    
     _flutterFFprobe.execute("-i file1.mp4").then((rc) => print("FFprobe process exited with rc $rc"));
    
    • Use executeWithArguments() method with an array of arguments
     import 'package:flutter_ffmpeg/flutter_ffmpeg.dart';
    
     final FlutterFFprobe _flutterFFprobe = new FlutterFFprobe();
    
     var arguments = ["-i", "file1.mp4"];
     _flutterFFprobe.executeWithArguments(arguments).then((rc) => print("FFprobe process exited with rc $rc"));
    
  3. Check execution output. Zero represents successful execution, non-zero values represent failure.

    
    final FlutterFFmpegConfig _flutterFFmpegConfig = new FlutterFFmpegConfig();
    
     _flutterFFmpegConfig.getLastReturnCode().then((rc) => print("Last rc: $rc"));
    
     _flutterFFmpegConfig.getLastCommandOutput().then((output) => print("Last command output: $output"));
    
  4. Stop an ongoing operation. Note that this function does not wait for termination to complete and returns immediately.

     _flutterFFmpeg.cancel();
    
  5. Get media information for a file.

    • Print all fields
    final FlutterFFprobe _flutterFFprobe = new FlutterFFprobe();
    
     _flutterFFprobe.getMediaInformation("<file path or uri>").then((info) => print(info));
    
    • Print selected fields
    final FlutterFFprobe _flutterFFprobe = new FlutterFFprobe();
    
     _flutterFFprobe.getMediaInformation("<file path or uri>").then((info) {
         print("Media Information");
    
         print("Path: ${info['path']}");
         print("Format: ${info['format']}");
         print("Duration: ${info['duration']}");
         print("Start time: ${info['startTime']}");
         print("Bitrate: ${info['bitrate']}");
    
         if (info['streams'] != null) {
             final streamsInfoArray = info['streams'];
    
             if (streamsInfoArray.length > 0) {
                 for (var streamsInfo in streamsInfoArray) {
                     print("Stream id: ${streamsInfo['index']}");
                     print("Stream type: ${streamsInfo['type']}");
                     print("Stream codec: ${streamsInfo['codec']}");
                     print("Stream full codec: ${streamsInfo['fullCodec']}");
                     print("Stream format: ${streamsInfo['format']}");
                     print("Stream full format: ${streamsInfo['fullFormat']}");
                     print("Stream width: ${streamsInfo['width']}");
                     print("Stream height: ${streamsInfo['height']}");
                     print("Stream bitrate: ${streamsInfo['bitrate']}");
                     print("Stream sample rate: ${streamsInfo['sampleRate']}");
                     print("Stream sample format: ${streamsInfo['sampleFormat']}");
                     print("Stream channel layout: ${streamsInfo['channelLayout']}");
                     print("Stream sar: ${streamsInfo['sampleAspectRatio']}");
                     print("Stream dar: ${streamsInfo['displayAspectRatio']}");
                     print("Stream average frame rate: ${streamsInfo['averageFrameRate']}");
                     print("Stream real frame rate: ${streamsInfo['realFrameRate']}");
                     print("Stream time base: ${streamsInfo['timeBase']}");
                     print("Stream codec time base: ${streamsInfo['codecTimeBase']}");
    
                     final metadataMap = streamsInfo['metadata'];
                     if (metadataMap != null) {
                         print('Stream metadata encoder: ${metadataMap['encoder']}');
                         print('Stream metadata rotate: ${metadataMap['rotate']}');
                         print('Stream metadata creation time: ${metadataMap['creation_time']}');
                         print('Stream metadata handler name: ${metadataMap['handler_name']}');
                     }
    
                     final sideDataMap = streamsInfo['sidedata'];
                     if (sideDataMap != null) {
                         print('Stream side data displaymatrix: ${sideDataMap['displaymatrix']}');
                     }
                 }
             }
         }
    
    
  6. Enable log callback and redirect all FFmpeg/FFprobe logs to a console/file/widget.

     void logCallback(int level, String message) {
         print(message);
     }
     ...
     _flutterFFmpegConfig.enableLogCallback(this.logCallback);
    
  7. Enable statistics callback and follow the progress of an ongoing FFmpeg operation.

     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");
     }
     ...
     _flutterFFmpegConfig.enableStatisticsCallback(this.statisticsCallback);
    
  8. Poll statistics without implementing statistics callback.

     _flutterFFmpegConfig.getLastReceivedStatistics().then((stats) => print(stats));
    
  9. Reset statistics before starting a new operation.

     _flutterFFmpegConfig.resetStatistics();
    
  10. Set log level.

    _flutterFFmpegConfig.setLogLevel(LogLevel.AV_LOG_WARNING);
    
  11. Register your own fonts by specifying a custom fonts directory, so they are available to use in FFmpeg filters. Please note that this function can not work on relative paths, you need to provide full file system path.

    _flutterFFmpegConfig.setFontDirectory("<folder with fonts>");
    
  12. Use your own fontconfig configuration.

    _flutterFFmpegConfig.setFontconfigConfigurationPath("<fontconfig configuration directory>");
    
  13. Disable log functionality of the library. Logs will not be printed to console and log callback will be disabled.

    _flutterFFmpegConfig.disableLogs();
    
  14. Disable statistics functionality of the library. Statistics callback will be disabled but the last received statistics data will be still available.

    _flutterFFmpegConfig.disableStatistics();
    
  15. List enabled external libraries.

    _flutterFFmpegConfig.getExternalLibraries().then((packageList) {
         packageList.forEach((value) => print("External library: $value"));
    });
    
  16. Create new FFmpeg pipe.

    _flutterFFmpegConfig.registerNewFFmpegPipe().then((path) {
         then((stats) => print("New ffmpeg pipe at $path"));
    });
    

4. Tips #

  • flutter_ffmpeg uses file system paths, it does not know what an assets folder or a project folder is. So you can't use resources on those folders directly, you need to provide full paths of those resources.

  • flutter_ffmpeg requires ios deployment target to be at least 9.3. If you don't specify a deployment target or set a value smaller than 9.3 then your build will fail with the following error.

      Resolving dependencies of `Podfile`
      [!] CocoaPods could not find compatible versions for pod "flutter_ffmpeg":
        In Podfile:
          flutter_ffmpeg (from `.symlinks/plugins/flutter_ffmpeg/ios`)
    
      Specs satisfying the `flutter_ffmpeg (from `.symlinks/plugins/flutter_ffmpeg/ios`)` dependency were found, but they required a higher minimum
      deployment target.
    

    You can fix this issue by adding platform :ios, '9.3' definition to your ios/Podfile file.

      platform :ios, '9.3'
    
  • flutter_ffmpeg includes native libraries that require ios deployment target to be at least 9.3. If a deployment target is not set or a value smaller than 9.3 is used then your build will fail with the following error.

      ld: targeted OS version does not support use of thread local variables in __gnutls_rnd_deinit for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    Unfortunately the latest versions of Flutter and Cocoapods have some issues about setting ios deployment target from Podfile. Having platform :ios, '9.3' in your Podfile is not enough. Runner project still uses the default value 8.0. You need to open Runner.xcworkspace in Xcode and set iOS Deployment Target of Runner project to 9.3 manually.

  • Enabling ProGuard on releases older than v0.2.4 causes linking errors. Please add the following rule inside your proguard-rules.pro file to preserve necessary method names and prevent linking errors.

      -keep class com.arthenica.mobileffmpeg.Config {
          native <methods>;
          void log(int, byte[]);
          void statistics(int, float, float, long , int, double, double);
      }
    
  • ffmpeg requires a valid fontconfig configuration to render subtitles. Unfortunately, Android does not include a default fontconfig configuration. So if you do not register a font or specify a fontconfig configuration under Android, then the burning process will not produce any errors but subtitles won't be burned in your file. You can overcome this situation by registering a font using setFontDirectory method or specifying your own fontconfig configuration using setFontconfigConfigurationPath method.

  • By default, Xcode compresses PNG files during packaging. If you use .png files in your commands make sure you set the following two settings to NO. If one of them is set to YES, your operations may fail with Error while decoding stream #0:0: Generic error in an external library error.

  • Some flutter_ffmpeg packages include libc++_shared.so native library. If a second library which also includes libc++_shared.so is added as a dependency, gradle fails with More than one file was found with OS independent path 'lib/x86/libc++_shared.so' error message.

    You can fix this error by adding the following block into your build.gradle.

    android {
        packagingOptions {
            pickFirst 'lib/x86/libc++_shared.so'
            pickFirst 'lib/x86_64/libc++_shared.so'
            pickFirst 'lib/armeabi-v7a/libc++_shared.so'
            pickFirst 'lib/arm64-v8a/libc++_shared.so'
        }
    }
    

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.

8. See Also #

0.2.10 #

  • Fixes issue #94

0.2.9 #

  • Implements FFprobe
  • Add concurrent execution support
  • Re-organises plugin classes
  • iOS releases depend on iconv system library instead of iconv external library

0.2.8 #

  • Uses ffmpeg v4.3
  • Implements registerNewFFmpegPipe API method

0.2.7 #

  • Uses new package selection mechanism
  • Fixes issue #52

0.2.6 #

  • Adds support for single quotes and double quotes in command strings

0.2.5 #

  • Implements side data information parsing

0.2.4 #

  • Adds support for Android devices with API Level 16+
  • Fixes issues #21 and #36
  • Removes conflicting attributes from AndroidManifest.xml
  • Includes ProGuard configuration file inside

0.2.3 #

  • Fixed flutter v1.6 compatibility errors on packages

0.2.2 #

  • Fixed flutter v1.6 compatibility errors

0.2.1 #

  • Fixed documentation errors
  • Updated package description

0.2.0 #

  • Added AndroidX support
  • Removed app icons for Android
  • Fixes issues #13 and #14

0.1.1 #

  • LTS release instructions added
  • Documentation updated

0.1.0 #

  • First release

example/lib/flutter_ffmpeg_example.dart

import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_ffmpeg/flutter_ffmpeg.dart';
import 'package:flutter_ffmpeg/log_level.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';

void main() => runApp(FlutterFFmpegTestApp());

class FlutterFFmpegTestApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primaryColor: Color(0xFFF46842),
      ),
      home: MainPage(),
    );
  }
}

class MainPage extends StatefulWidget {
  @override
  FlutterFFmpegTestAppState createState() => new FlutterFFmpegTestAppState();
}

class DecoratedTabBar extends StatelessWidget implements PreferredSizeWidget {
  DecoratedTabBar({@required this.tabBar, @required this.decoration});

  final TabBar tabBar;
  final BoxDecoration decoration;

  @override
  Size get preferredSize => tabBar.preferredSize;

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(child: Container(decoration: decoration)),
        tabBar,
      ],
    );
  }
}

class VideoUtil {
  static Future<Directory> get tempDirectory async {
    return await getTemporaryDirectory();
  }

  static Future<File> copyFileAssets(String assetName, String localName) async {
    final ByteData assetByteData = await rootBundle.load(assetName);

    final List<int> byteList = assetByteData.buffer
        .asUint8List(assetByteData.offsetInBytes, assetByteData.lengthInBytes);

    final String fullTemporaryPath =
        join((await tempDirectory).path, localName);

    return new File(fullTemporaryPath)
        .writeAsBytes(byteList, mode: FileMode.writeOnly, flush: true);
  }

  static Future<String> assetPath(String assetName) async {
    return join((await tempDirectory).path, assetName);
  }

  static String generateEncodeVideoScript(
      String image1Path,
      String image2Path,
      String image3Path,
      String videoFilePath,
      String videoCodec,
      String customOptions) {
    return "-hide_banner    -y -loop   1 -i '" +
        image1Path +
        "' " +
        "-loop   1 -i \"" +
        image2Path +
        "\" " +
        "-loop 1   -i \"" +
        image3Path +
        "\" " +
        "-filter_complex " +
        "\"[0:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,640/427),min(iw,640),-1)':h='if(gte(iw/ih,640/427),-1,min(ih,427))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream1out1][stream1out2];" +
        "[1:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,640/427),min(iw,640),-1)':h='if(gte(iw/ih,640/427),-1,min(ih,427))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream2out1][stream2out2];" +
        "[2:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,640/427),min(iw,640),-1)':h='if(gte(iw/ih,640/427),-1,min(ih,427))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream3out1][stream3out2];" +
        "[stream1out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3,select=lte(n\\,90)[stream1overlaid];" +
        "[stream1out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream1ending];" +
        "[stream2out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream2overlaid];" +
        "[stream2out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30),split=2[stream2starting][stream2ending];" +
        "[stream3out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream3overlaid];" +
        "[stream3out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream3starting];" +
        "[stream2starting][stream1ending]blend=all_expr='if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)':shortest=1[stream2blended];" +
        "[stream3starting][stream2ending]blend=all_expr='if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)':shortest=1[stream3blended];" +
        "[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
        " -map [video] -vsync 2 -async 1 " +
        customOptions +
        "-c:v " +
        videoCodec +
        " -r 30 " +
        videoFilePath;
  }
}

class FlutterFFmpegTestAppState extends State<MainPage>
    with TickerProviderStateMixin {
  static const String ASSET_1 = "1.jpg";
  static const String ASSET_2 = "2.jpg";
  static const String ASSET_3 = "3.jpg";

  final FlutterFFmpegConfig _flutterFFmpegConfig = new FlutterFFmpegConfig();
  final FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg();
  final FlutterFFprobe _flutterFFprobe = new FlutterFFprobe();

  TextEditingController _commandController;
  TabController _controller;
  String _commandOutput;
  String _encodeOutput;
  String _currentCodec;
  List<DropdownMenuItem<String>> _codecDropDownMenuItems;

  @override
  void initState() {
    super.initState();

    _commandController = TextEditingController();
    _controller = TabController(length: 2, vsync: this);
    _commandOutput = "";
    _encodeOutput = "";

    _codecDropDownMenuItems = _getCodecDropDownMenuItems();
    _currentCodec = _codecDropDownMenuItems[0].value;

    startupTests();

    prepareAssets();
  }

  void startupTests() {
    getFFmpegVersion().then((version) => print("FFmpeg version: $version"));
    getPlatform().then((platform) => print("Platform: $platform"));
    getLogLevel().then(
        (level) => print("Old log level: " + LogLevel.levelToString(level)));
    setLogLevel(LogLevel.AV_LOG_INFO);
    getLogLevel().then(
        (level) => print("New log level: " + LogLevel.levelToString(level)));
    getPackageName().then((packageName) => print("Package name: $packageName"));
    getExternalLibraries().then((packageList) {
      packageList.forEach((value) => print("External library: $value"));
    });
  }

  void prepareAssets() {
    VideoUtil.copyFileAssets('assets/pyramid.jpg', ASSET_1)
        .then((path) => print('Loaded asset $path.'));
    VideoUtil.copyFileAssets('assets/colosseum.jpg', ASSET_2)
        .then((path) => print('Loaded asset $path.'));
    VideoUtil.copyFileAssets('assets/tajmahal.jpg', ASSET_3)
        .then((path) => print('Loaded asset $path.'));
  }

  void testParseArguments() {
    testParseSimpleCommand();
    testParseSingleQuotesInCommand();
    testParseDoubleQuotesInCommand();
    testParseDoubleQuotesAndEscapesInCommand();
  }

  void testRunFFmpegCommand() {
    getLastReturnCode().then((rc) => print("Last rc: $rc"));
    getLastCommandOutput().then((output) =>
        debugPrint("Last command output: \"$output\"", wrapWidth: 1024));

    print("Testing ParseArguments.");

    testParseArguments();
    registerNewFFmpegPipe().then((path) => print("New FFmpeg pipe: $path"));

    print("Testing FFmpeg COMMAND.");

    // ENABLE LOG CALLBACK ON EACH CALL
    _flutterFFmpegConfig.enableLogCallback(commandOutputLogCallback);
    _flutterFFmpegConfig.enableStatisticsCallback(statisticsCallback);

    // CLEAR OUTPUT ON EACH EXECUTION
    _commandOutput = "";

    // COMMENT OPTIONAL TESTS
    // VideoUtil.tempDirectory.then((tempDirectory) {
    //    Map<String, String> mapNameMap = new Map();
    //    mapNameMap["my_custom_font"] = "my custom font";
    //    setFontDirectory(tempDirectory.path, null);
    // });

    VideoUtil.tempDirectory.then((tempDirectory) {
      setFontconfigConfigurationPath(tempDirectory.path);
    });

    // disableRedirection();

    // disableLogs();
    // enableLogs();

    executeFFmpeg(_commandController.text)
        .then((rc) => print("FFmpeg process exited with rc $rc"));
    // executeWithArguments(_commandController.text.split(" ")).then((rc) => print("FFmpeg process exited with rc $rc"));

    setState(() {});
  }

  void testRunFFprobeCommand() {
    getLastReturnCode().then((rc) => print("Last rc: $rc"));
    getLastCommandOutput().then((output) =>
        debugPrint("Last command output: \"$output\"", wrapWidth: 1024));

    print("Testing ParseArguments.");

    testParseArguments();
    registerNewFFmpegPipe().then((path) => print("New FFmpeg pipe: $path"));

    print("Testing FFprobe COMMAND.");

    // ENABLE LOG CALLBACK ON EACH CALL
    _flutterFFmpegConfig.enableLogCallback(commandOutputLogCallback);
    _flutterFFmpegConfig.enableStatisticsCallback(statisticsCallback);

    // CLEAR OUTPUT ON EACH EXECUTION
    _commandOutput = "";

    VideoUtil.tempDirectory.then((tempDirectory) {
      setFontconfigConfigurationPath(tempDirectory.path);
    });

    executeFFprobe(_commandController.text)
        .then((rc) => print("FFprobe process exited with rc $rc"));

    setState(() {});
  }

  void testGetMediaInformation(String mediaPath) {
    print("Testing Get Media Information.");

    // ENABLE LOG CALLBACK ON EACH CALL
    _flutterFFmpegConfig.enableLogCallback(commandOutputLogCallback);
    _flutterFFmpegConfig.enableStatisticsCallback(null);

    // CLEAR OUTPUT ON EACH EXECUTION
    _commandOutput = "";

    VideoUtil.assetPath(mediaPath).then((image1Path) {
      getMediaInformation(image1Path).then((info) {
        print('Media Information');

        print('Path: ${info['path']}');
        print('Format: ${info['format']}');
        print('Duration: ${info['duration']}');
        print('Start time: ${info['startTime']}');
        print('Bitrate: ${info['bitrate']}');

        if (info['streams'] != null) {
          final streamsInfoArray = info['streams'];

          if (streamsInfoArray.length > 0) {
            for (var streamsInfo in streamsInfoArray) {
              print('Stream id: ${streamsInfo['index']}');
              print('Stream type: ${streamsInfo['type']}');
              print('Stream codec: ${streamsInfo['codec']}');
              print('Stream full codec: ${streamsInfo['fullCodec']}');
              print('Stream format: ${streamsInfo['format']}');
              print('Stream full format: ${streamsInfo['fullFormat']}');
              print('Stream width: ${streamsInfo['width']}');
              print('Stream height: ${streamsInfo['height']}');
              print('Stream bitrate: ${streamsInfo['bitrate']}');
              print('Stream sample rate: ${streamsInfo['sampleRate']}');
              print('Stream sample format: ${streamsInfo['sampleFormat']}');
              print('Stream channel layout: ${streamsInfo['channelLayout']}');
              print('Stream sar: ${streamsInfo['sampleAspectRatio']}');
              print('Stream dar: ${streamsInfo['displayAspectRatio']}');
              print(
                  'Stream average frame rate: ${streamsInfo['averageFrameRate']}');
              print('Stream real frame rate: ${streamsInfo['realFrameRate']}');
              print('Stream time base: ${streamsInfo['timeBase']}');
              print('Stream codec time base: ${streamsInfo['codecTimeBase']}');

              final metadataMap = streamsInfo['metadata'];
              if (metadataMap != null) {
                print('Stream metadata encoder: ${metadataMap['encoder']}');
                print('Stream metadata rotate: ${metadataMap['rotate']}');
                print(
                    'Stream metadata creation time: ${metadataMap['creation_time']}');
                print(
                    'Stream metadata handler name: ${metadataMap['handler_name']}');
              }

              final sideDataMap = streamsInfo['sidedata'];
              if (sideDataMap != null) {
                print(
                    'Stream side data displaymatrix: ${sideDataMap['displaymatrix']}');
              }
            }
          }
        }
      });
    });

    setState(() {});
  }

  void testEncodeVideo() {
    print("Testing VIDEO.");

    // ENABLE LOG CALLBACK ON EACH CALL
    _flutterFFmpegConfig.enableLogCallback(encodeOutputLogCallback);
    _flutterFFmpegConfig.enableStatisticsCallback(statisticsCallback);

    // CLEAR OUTPUT ON EACH EXECUTION
    _encodeOutput = "";

    disableStatistics();
    enableStatistics();

    VideoUtil.assetPath(ASSET_1).then((image1Path) {
      VideoUtil.assetPath(ASSET_2).then((image2Path) {
        VideoUtil.assetPath(ASSET_3).then((image3Path) {
          final String videoPath = getVideoPath();
          final String customOptions = getCustomEncodingOptions();
          final String ffmpegCodec = getFFmpegCodecName();

          VideoUtil.assetPath(videoPath).then((fullVideoPath) {
            executeFFmpeg(VideoUtil.generateEncodeVideoScript(image1Path, image2Path,
                    image3Path, fullVideoPath, ffmpegCodec, customOptions))
                .then((rc) {
              if (rc == 0) {
                testGetMediaInformation(fullVideoPath);
              }
            });

            // resetStatistics();

            getLastReceivedStatistics().then((lastStatistics) {
              if (lastStatistics == null) {
                print('No last statistics');
              } else {
                print('Last statistics');

                int time = lastStatistics['time'];
                int size = lastStatistics['size'];

                double bitrate = _doublePrecision(lastStatistics['bitrate'], 2);
                double speed = _doublePrecision(lastStatistics['speed'], 2);
                int videoFrameNumber = lastStatistics['videoFrameNumber'];
                double videoQuality =
                    _doublePrecision(lastStatistics['videoQuality'], 2);
                double videoFps =
                    _doublePrecision(lastStatistics['videoFps'], 2);

                statisticsCallback(time, size, bitrate, speed, videoFrameNumber,
                    videoQuality, videoFps);
              }
            });
          });
        });
      });
    });

    setState(() {});
  }

  void commandOutputLogCallback(int level, String message) {
    _commandOutput += message;
    setState(() {});
  }

  void encodeOutputLogCallback(int level, String message) {
    _encodeOutput += message;
    setState(() {});
  }

  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");
  }

  Future<String> getFFmpegVersion() async {
    return await _flutterFFmpegConfig.getFFmpegVersion();
  }

  Future<String> getPlatform() async {
    return await _flutterFFmpegConfig.getPlatform();
  }

  Future<int> executeFFmpegWithArguments(List arguments) async {
    return await _flutterFFmpeg.executeWithArguments(arguments);
  }

  Future<int> executeFFmpeg(String command) async {
    return await _flutterFFmpeg.execute(command);
  }

  Future<int> executeFFprobeWithArguments(List arguments) async {
    return await _flutterFFprobe.executeWithArguments(arguments);
  }

  Future<int> executeFFprobe(String command) async {
    return await _flutterFFprobe.execute(command);
  }

  Future<void> cancel() async {
    return await _flutterFFmpeg.cancel();
  }

  Future<void> disableRedirection() async {
    return await _flutterFFmpegConfig.disableRedirection();
  }

  Future<int> getLogLevel() async {
    return await _flutterFFmpegConfig.getLogLevel();
  }

  Future<void> setLogLevel(int logLevel) async {
    return await _flutterFFmpegConfig.setLogLevel(logLevel);
  }

  Future<void> enableLogs() async {
    return await _flutterFFmpegConfig.enableLogs();
  }

  Future<void> disableLogs() async {
    return await _flutterFFmpegConfig.disableLogs();
  }

  Future<void> enableStatistics() async {
    return await _flutterFFmpegConfig.enableStatistics();
  }

  Future<void> disableStatistics() async {
    return await _flutterFFmpegConfig.disableStatistics();
  }

  Future<Map<dynamic, dynamic>> getLastReceivedStatistics() async {
    return await _flutterFFmpegConfig.getLastReceivedStatistics();
  }

  Future<void> resetStatistics() async {
    return await _flutterFFmpegConfig.resetStatistics();
  }

  Future<void> setFontconfigConfigurationPath(String path) async {
    return await _flutterFFmpegConfig.setFontconfigConfigurationPath(path);
  }

  Future<void> setFontDirectory(
      String fontDirectory, Map<String, String> fontNameMap) async {
    return await _flutterFFmpegConfig.setFontDirectory(fontDirectory, fontNameMap);
  }

  Future<String> getPackageName() async {
    return await _flutterFFmpegConfig.getPackageName();
  }

  Future<List<dynamic>> getExternalLibraries() async {
    return await _flutterFFmpegConfig.getExternalLibraries();
  }

  Future<int> getLastReturnCode() async {
    return await _flutterFFmpegConfig.getLastReturnCode();
  }

  Future<String> getLastCommandOutput() async {
    return await _flutterFFmpegConfig.getLastCommandOutput();
  }

  Future<Map<dynamic, dynamic>> getMediaInformation(String path) async {
    return await _flutterFFprobe.getMediaInformation(path);
  }

  Future<String> registerNewFFmpegPipe() async {
    return await _flutterFFmpegConfig.registerNewFFmpegPipe();
  }

  void _changedCodec(String selectedCodec) {
    setState(() {
      _currentCodec = selectedCodec;
    });
  }

  String getFFmpegCodecName() {
    String ffmpegCodec = _currentCodec;

    // VIDEO CODEC MENU HAS BASIC NAMES, FFMPEG NEEDS LONGER LIBRARY NAMES.
    if (ffmpegCodec == "x264") {
      ffmpegCodec = "libx264";
    } else if (ffmpegCodec == "x265") {
      ffmpegCodec = "libx265";
    } else if (ffmpegCodec == "xvid") {
      ffmpegCodec = "libxvid";
    } else if (ffmpegCodec == "vp8") {
      ffmpegCodec = "libvpx";
    } else if (ffmpegCodec == "vp9") {
      ffmpegCodec = "libvpx-vp9";
    }

    return ffmpegCodec;
  }

  String getVideoPath() {
    String ffmpegCodec = _currentCodec;

    String videoPath;
    if ((ffmpegCodec == "vp8") || (ffmpegCodec == "vp9")) {
      videoPath = "video.webm";
    } else {
      // mpeg4, x264, x265, xvid
      videoPath = "video.mp4";
    }

    return videoPath;
  }

  String getCustomEncodingOptions() {
    String videoCodec = _currentCodec;

    if (videoCodec == "x265") {
      return "-crf 28 -preset fast ";
    } else if (videoCodec == "vp8") {
      return "-b:v 1M -crf 10 ";
    } else if (videoCodec == "vp9") {
      return "-b:v 2M ";
    } else {
      return "";
    }
  }

  List<DropdownMenuItem<String>> _getCodecDropDownMenuItems() {
    List<DropdownMenuItem<String>> items = new List();

    items.add(new DropdownMenuItem(value: "mpeg4", child: new Text("mpeg4")));
    items.add(new DropdownMenuItem(value: "x264", child: new Text("x264")));
    items.add(new DropdownMenuItem(value: "x265", child: new Text("x265")));
    items.add(new DropdownMenuItem(value: "xvid", child: new Text("xvid")));
    items.add(new DropdownMenuItem(value: "vp8", child: new Text("vp8")));
    items.add(new DropdownMenuItem(value: "vp9", child: new Text("vp9")));

    return items;
  }

  double _doublePrecision(double value, int precision) {
    if (value == null) {
      return 0;
    } else {
      return num.parse(value.toStringAsFixed(precision));
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('FlutterFFmpeg Test'),
          centerTitle: true,
        ),
        bottomNavigationBar: Material(
          child: DecoratedTabBar(
            tabBar: TabBar(
              tabs: <Tab>[
                Tab(text: "COMMAND"),
                Tab(
                  text: "VIDEO",
                )
              ],
              controller: _controller,
              labelColor: Color(0xFF1e90ff),
              unselectedLabelColor: Color(0xFF808080),
            ),
            decoration: BoxDecoration(
              border: Border(
                top: BorderSide(
                  color: Color(0xFF808080),
                  width: 1.0,
                ),
                bottom: BorderSide(
                  width: 0.0,
                ),
              ),
            ),
          ),
        ),
        body: TabBarView(
          children: <Widget>[
            Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Container(
                  padding: const EdgeInsets.fromLTRB(20, 40, 20, 40),
                  child: TextField(
                    controller: _commandController,
                    decoration: InputDecoration(
                        border: const OutlineInputBorder(
                          borderSide:
                              const BorderSide(color: Color(0xFF3498DB)),
                          borderRadius: const BorderRadius.all(
                            const Radius.circular(5),
                          ),
                        ),
                        focusedBorder: const OutlineInputBorder(
                          borderSide:
                              const BorderSide(color: Color(0xFF3498DB)),
                          borderRadius: const BorderRadius.all(
                            const Radius.circular(5),
                          ),
                        ),
                        enabledBorder: const OutlineInputBorder(
                          borderSide:
                              const BorderSide(color: Color(0xFF3498DB)),
                          borderRadius: const BorderRadius.all(
                            const Radius.circular(5),
                          ),
                        ),
                        contentPadding: EdgeInsets.fromLTRB(8, 12, 8, 12),
                        hintStyle: new TextStyle(
                            fontSize: 14, color: Colors.grey[400]),
                        hintText: "Enter command"),
                    style: new TextStyle(fontSize: 14, color: Colors.black),
                  ),
                ),
                Container(
                  padding: const EdgeInsets.only(bottom: 20),
                  child: new InkWell(
                    onTap: () => testRunFFmpegCommand(),
                    child: new Container(
                      width: 130,
                      height: 38,
                      decoration: new BoxDecoration(
                        color: Color(0xFF2ECC71),
                        borderRadius: new BorderRadius.circular(5),
                      ),
                      child: new Center(
                        child: new Text(
                          'RUN FFMPEG',
                          style: new TextStyle(
                              fontSize: 14.0,
                              fontWeight: FontWeight.bold,
                              color: Colors.white),
                        ),
                      ),
                    ),
                  ),
                ),
                Container(
                  padding: const EdgeInsets.only(bottom: 20),
                  child: new InkWell(
                    onTap: () => testRunFFprobeCommand(),
                    child: new Container(
                      width: 130,
                      height: 38,
                      decoration: new BoxDecoration(
                        color: Color(0xFF2ECC71),
                        borderRadius: new BorderRadius.circular(5),
                      ),
                      child: new Center(
                        child: new Text(
                          'RUN FFPROBE',
                          style: new TextStyle(
                              fontSize: 14.0,
                              fontWeight: FontWeight.bold,
                              color: Colors.white),
                        ),
                      ),
                    ),
                  ),
                ),
                Expanded(
                  child: Container(
                      alignment: Alignment(-1.0, -1.0),
                      margin: EdgeInsets.all(20.0),
                      padding: EdgeInsets.all(4.0),
                      decoration: new BoxDecoration(
                          borderRadius:
                              BorderRadius.all(new Radius.circular(5)),
                          color: Color(0xFFF1C40F)),
                      child: SingleChildScrollView(
                          reverse: true, child: Text(_commandOutput))),
                )
              ],
            ),
            Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Container(
                    padding: const EdgeInsets.fromLTRB(20, 40, 20, 40),
                    child: Container(
                      width: 200,
                      alignment: Alignment(0.0, 0.0),
                      decoration: BoxDecoration(
                          color: Color.fromRGBO(155, 89, 182, 1.0),
                          borderRadius: BorderRadius.circular(5)),
                      child: DropdownButtonHideUnderline(
                          child: DropdownButton(
                        style: new TextStyle(
                          fontSize: 14,
                          color: Colors.black,
                        ),
                        value: _currentCodec,
                        items: _codecDropDownMenuItems,
                        onChanged: _changedCodec,
                        iconSize: 0,
                        isExpanded: false,
                      )),
                    )),
                Container(
                  padding: const EdgeInsets.only(bottom: 20),
                  child: new InkWell(
                    onTap: () => testEncodeVideo(),
                    child: new Container(
                      width: 100,
                      height: 38,
                      decoration: new BoxDecoration(
                        color: Color(0xFF2ECC71),
                        borderRadius: new BorderRadius.circular(5),
                      ),
                      child: new Center(
                        child: new Text(
                          'ENCODE',
                          style: new TextStyle(
                              fontSize: 14.0,
                              fontWeight: FontWeight.bold,
                              color: Colors.white),
                        ),
                      ),
                    ),
                  ),
                ),
                Expanded(
                  child: Container(
                      alignment: Alignment(-1.0, -1.0),
                      margin: EdgeInsets.all(20.0),
                      padding: EdgeInsets.all(4.0),
                      decoration: new BoxDecoration(
                          borderRadius:
                              BorderRadius.all(new Radius.circular(5)),
                          color: Color(0xFFF1C40F)),
                      child: SingleChildScrollView(
                          reverse: true, child: Text(_encodeOutput))),
                )
              ],
            ),
          ],
          controller: _controller,
        ));
  }

  @override
  void dispose() {
    super.dispose();
    _commandController.dispose();
  }

  void testParseSimpleCommand() {
    var argumentArray = FlutterFFmpeg.parseArguments(
        "-hide_banner   -loop 1  -i file.jpg  -filter_complex  [0:v]setpts=PTS-STARTPTS[video] -map [video] -vsync 2 -async 1  video.mp4");

    assert(argumentArray != null);
    assert(argumentArray.length == 14);

    assert("-hide_banner" == argumentArray[0]);
    assert("-loop" == argumentArray[1]);
    assert("1" == argumentArray[2]);
    assert("-i" == argumentArray[3]);
    assert("file.jpg" == argumentArray[4]);
    assert("-filter_complex" == argumentArray[5]);
    assert("[0:v]setpts=PTS-STARTPTS[video]" == argumentArray[6]);
    assert("-map" == argumentArray[7]);
    assert("[video]" == argumentArray[8]);
    assert("-vsync" == argumentArray[9]);
    assert("2" == argumentArray[10]);
    assert("-async" == argumentArray[11]);
    assert("1" == argumentArray[12]);
    assert("video.mp4" == argumentArray[13]);
  }

  void testParseSingleQuotesInCommand() {
    var argumentArray = FlutterFFmpeg.parseArguments(
        "-loop 1 'file one.jpg'  -filter_complex  '[0:v]setpts=PTS-STARTPTS[video]'  -map  [video]  video.mp4 ");

    assert(argumentArray != null);
    assert(argumentArray.length == 8);

    assert("-loop" == argumentArray[0]);
    assert("1" == argumentArray[1]);
    assert("file one.jpg" == argumentArray[2]);
    assert("-filter_complex" == argumentArray[3]);
    assert("[0:v]setpts=PTS-STARTPTS[video]" == argumentArray[4]);
    assert("-map" == argumentArray[5]);
    assert("[video]" == argumentArray[6]);
    assert("video.mp4" == argumentArray[7]);
  }

  void testParseDoubleQuotesInCommand() {
    var argumentArray = FlutterFFmpeg.parseArguments(
        "-loop  1 \"file one.jpg\"   -filter_complex \"[0:v]setpts=PTS-STARTPTS[video]\"  -map  [video]  video.mp4 ");

    assert(argumentArray != null);
    assert(argumentArray.length == 8);

    assert("-loop" == argumentArray[0]);
    assert("1" == argumentArray[1]);
    assert("file one.jpg" == argumentArray[2]);
    assert("-filter_complex" == argumentArray[3]);
    assert("[0:v]setpts=PTS-STARTPTS[video]" == argumentArray[4]);
    assert("-map" == argumentArray[5]);
    assert("[video]" == argumentArray[6]);
    assert("video.mp4" == argumentArray[7]);

    argumentArray = FlutterFFmpeg.parseArguments(
        " -i   file:///tmp/input.mp4 -vcodec libx264 -vf \"scale=1024:1024,pad=width=1024:height=1024:x=0:y=0:color=black\"  -acodec copy  -q:v 0  -q:a   0 video.mp4");

    assert(argumentArray != null);
    assert(argumentArray.length == 13);

    assert("-i" == argumentArray[0]);
    assert("file:///tmp/input.mp4" == argumentArray[1]);
    assert("-vcodec" == argumentArray[2]);
    assert("libx264" == argumentArray[3]);
    assert("-vf" == argumentArray[4]);
    assert("scale=1024:1024,pad=width=1024:height=1024:x=0:y=0:color=black" ==
        argumentArray[5]);
    assert("-acodec" == argumentArray[6]);
    assert("copy" == argumentArray[7]);
    assert("-q:v" == argumentArray[8]);
    assert("0" == argumentArray[9]);
    assert("-q:a" == argumentArray[10]);
    assert("0" == argumentArray[11]);
    assert("video.mp4" == argumentArray[12]);
  }

  void testParseDoubleQuotesAndEscapesInCommand() {
    var argumentArray = FlutterFFmpeg.parseArguments(
        "  -i   file:///tmp/input.mp4 -vf \"subtitles=file:///tmp/subtitles.srt:force_style=\'FontSize=16,PrimaryColour=&HFFFFFF&\'\" -vcodec libx264   -acodec copy  -q:v 0 -q:a  0  video.mp4");

    assert(argumentArray != null);
    assert(argumentArray.length == 13);

    assert("-i" == argumentArray[0]);
    assert("file:///tmp/input.mp4" == argumentArray[1]);
    assert("-vf" == argumentArray[2]);
    assert(
        "subtitles=file:///tmp/subtitles.srt:force_style='FontSize=16,PrimaryColour=&HFFFFFF&'" ==
            argumentArray[3]);
    assert("-vcodec" == argumentArray[4]);
    assert("libx264" == argumentArray[5]);
    assert("-acodec" == argumentArray[6]);
    assert("copy" == argumentArray[7]);
    assert("-q:v" == argumentArray[8]);
    assert("0" == argumentArray[9]);
    assert("-q:a" == argumentArray[10]);
    assert("0" == argumentArray[11]);
    assert("video.mp4" == argumentArray[12]);

    argumentArray = FlutterFFmpeg.parseArguments(
        "  -i   file:///tmp/input.mp4 -vf \"subtitles=file:///tmp/subtitles.srt:force_style=\\\"FontSize=16,PrimaryColour=&HFFFFFF&\\\"\" -vcodec libx264   -acodec copy  -q:v 0 -q:a  0  video.mp4");

    assert(argumentArray != null);
    assert(argumentArray.length == 13);

    assert("-i" == argumentArray[0]);
    assert("file:///tmp/input.mp4" == argumentArray[1]);
    assert("-vf" == argumentArray[2]);
    assert(
        "subtitles=file:///tmp/subtitles.srt:force_style=\\\"FontSize=16,PrimaryColour=&HFFFFFF&\\\"" ==
            argumentArray[3]);
    assert("-vcodec" == argumentArray[4]);
    assert("libx264" == argumentArray[5]);
    assert("-acodec" == argumentArray[6]);
    assert("copy" == argumentArray[7]);
    assert("-q:v" == argumentArray[8]);
    assert("0" == argumentArray[9]);
    assert("-q:a" == argumentArray[10]);
    assert("0" == argumentArray[11]);
    assert("video.mp4" == argumentArray[12]);
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_ffmpeg: ^0.2.10

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_ffmpeg/flutter_ffmpeg.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
92
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
96
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
path ^1.6.4
path_provider ^1.5.1