GithubHelp home page GithubHelp logo

thanhit93 / video_editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from legoffmael/video_editor

0.0 1.0 0.0 9.42 MB

FLUTTER API: Video Editor allows trim, crop, rotate and scale video with a super flexible UI Design

Home Page: https://pub.dev/packages/video_editor

License: MIT License

Kotlin 0.13% Swift 0.43% Objective-C 0.04% Dart 96.37% Ruby 3.03%

video_editor's Introduction

video_editor


My other APIs


Features

  • Super flexible UI Design.
  • Support actions:
    • Crop
    • Trim
    • Scale
    • Rotate
    • Cover selection



Installation (More info on Flutter FFMPEG)

Android

Add on android/build.gradle file and define package name in ext.flutterFFmpegPackage variable.

ext.flutterFFmpegPackage = "min-gpl-lts"

iOS

(Flutter >= 2.x)

  • Edit ios/Podfile, add the following block before target 'Runner do and specify the package name in min-gpl-lts section:

      # "fork" of method flutter_install_plugin_pods (in fluttertools podhelpers.rb) to get lts version of ffmpeg
      def flutter_install_plugin_pods(application_path = nil, relative_symlink_dir, platform)
        # defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
        application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file)
        raise 'Could not find application path' unless application_path
    
        # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
        # referring to absolute paths on developers' machines.
    
        symlink_dir = File.expand_path(relative_symlink_dir, application_path)
        system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils.
    
        symlink_plugins_dir = File.expand_path('plugins', symlink_dir)
        system('mkdir', '-p', symlink_plugins_dir)
    
        plugins_file = File.join(application_path, '..', '.flutter-plugins-dependencies')
        plugin_pods = flutter_parse_plugins_file(plugins_file, platform)
        plugin_pods.each do |plugin_hash|
          plugin_name = plugin_hash['name']
          plugin_path = plugin_hash['path']
          if (plugin_name && plugin_path)
            symlink = File.join(symlink_plugins_dir, plugin_name)
            File.symlink(plugin_path, symlink)
    
            if plugin_name == 'flutter_ffmpeg'
              pod 'flutter_ffmpeg/min-gpl-lts', :path => File.join(relative_symlink_dir, 'plugins', plugin_name, platform)
            else
              pod plugin_name, :path => File.join(relative_symlink_dir, 'plugins', plugin_name, platform)
            end
          end
        end
      end

(Flutter >= 1.20.x) && (Flutter < 2.x)

  • Edit ios/Podfile, add the following block before target 'Runner do and specify the package name in min-gpl-lts section:

      # "fork" of method flutter_install_ios_plugin_pods (in fluttertools podhelpers.rb) to get lts version of ffmpeg
      def flutter_install_ios_plugin_pods(ios_application_path = nil)
       # defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
        ios_application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file)
        raise 'Could not find iOS application path' unless ios_application_path
    
        # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
        # referring to absolute paths on developers' machines.
    
        symlink_dir = File.expand_path('.symlinks', ios_application_path)
        system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils.
    
        symlink_plugins_dir = File.expand_path('plugins', symlink_dir)
        system('mkdir', '-p', symlink_plugins_dir)
    
        plugins_file = File.join(ios_application_path, '..', '.flutter-plugins-dependencies')
        plugin_pods = flutter_parse_plugins_file(plugins_file)
        plugin_pods.each do |plugin_hash|
          plugin_name = plugin_hash['name']
          plugin_path = plugin_hash['path']
    
          if (plugin_name && plugin_path)
              symlink = File.join(symlink_plugins_dir, plugin_name)
              File.symlink(plugin_path, symlink)
    
              if plugin_name == 'flutter_ffmpeg'
                  pod plugin_name + '/min-gpl-lts', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
              else
                  pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
              end
          end
        end
      end
  • Ensure that flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) function is called within target 'Runner' do block. In that case, it is mandatory that the added function is named flutter_install_ios_plugin_pods and that you do not make an explicit call within that block.

(Flutter < 1.20.x)

  • Edit ios/Podfile file and modify the default # Plugin Pods block as follows. Do not forget to specify the package name in min-gpl-lts 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+'/min-gpl-lts', :path => File.join(symlink, 'ios')
          else
              pod name, :path => File.join(symlink, 'ios')
          end
      end



Example (The UI Design is fully customizable on the example)


Crop Video Rotate Video

Trim Video Export Video
Trimmer if maxDuration < videoDuration Trim timeline
Video cover (selection, viewer) Export cover



Main Contributors


Le Goff Maël

video_editor's People

Contributors

felipemurguia avatar legoffmael avatar seel-channel avatar paricleu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.