Flutter video trimmer package

Last update: Aug 7, 2022
Awesome Flutter Pub Version GitHub stars GitHub license

Video Trimmer

A Flutter package for trimming videos

Features

  • Customizable video trimmer
  • Video playback control
  • Retrieving and storing video file

Also, supports conversion to GIF.

TRIM EDITOR

Trim Editor

EXAMPLE APP

Trimmer

CUSTOMIZABLE VIDEO EDITOR

Trim Editor

Usage

  • Add the dependency video_trimmer to your pubspec.yaml file.

Android

  • Go to <project root>/android/app/build.gradle and set the proper minSdkVersion, 24 for Main Release or 16 for LTS Release.

    Refer to the FFmpeg Release section.

    minSdkVersion <version>
  • Go to <project root>/android/build.gradle and add the following line:

    ext.flutterFFmpegPackage = '<package name>'

    Replace the <package name> with a proper package name from the Packages List section.

iOS

  • Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

    <key>NSCameraUsageDescription</key>
    <string>Used to demonstrate image picker plugin</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Used to capture audio for image picker plugin</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Used to demonstrate image picker plugin</string>
    
  • Set the platform version in ios/Podfile, 11.0 for Main Release or 9.3 for LTS Release.

    Refer to the FFmpeg Release section.

    platform :ios, '<version>'
    
  • [Flutter >= 1.20.x] Edit ios/Podfile and add the following block before target 'Runner' do section:

    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 'flutter_ffmpeg/<package name>', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
          else
              pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
          end
        end
      end
    end
    

    Replace the <package name> with a proper package name from the Packages List section.

  • [Flutter < 1.20.x] Edit ios/Podfile file and modify the default # Plugin Pods block as follows.

    # 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
    

    Replace the <package name> with a proper package name from the Packages List section.

FFmpeg Release

In reference to the releases specified in the flutter_ffmpeg package.

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

Packages List

The following FFmpeg Packages List is in reference to the flutter_ffmpeg package.

Package Main Release LTS Release
min min min-lts
min-gpl min-gpl min-gpl-lts
https https https-lts
https-gpl https-gpl https-gpl-lts
audio audio audio-lts
video video video-lts
full full full-lts
full-gpl full-gpl full-gpl-lts

Functionalities

Loading input video file

final Trimmer _trimmer = Trimmer();
await _trimmer.loadVideo(videoFile: file);

Saving trimmed video

Returns a string to indicate whether the saving operation was successful.

await _trimmer
    .saveTrimmedVideo(startValue: _startValue, endValue: _endValue)
    .then((value) {
  setState(() {
    _value = value;
  });
});

Video playback state

Returns the video playback state. If true then the video is playing, otherwise it is paused.

await _trimmer.videPlaybackControl(
  startValue: _startValue,
  endValue: _endValue,
);

Advanced Command

You can use an advanced FFmpeg command if you require more customization. Just define your FFmpeg command using the ffmpegCommand property and set an output video format using customVideoFormat.

Refer to the Official FFmpeg Documentation for more information.

NOTE: Passing a wrong video format to the customVideoFormat property may result in a crash.

// Example of defining a custom command

// This is already used for creating GIF by
// default, so you do not need to use this.

await _trimmer
    .saveTrimmedVideo(
        startValue: _startValue,
        endValue: _endValue,
        ffmpegCommand:
            '-vf "fps=10,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0',
        customVideoFormat: '.gif')
    .then((value) {
  setState(() {
    _value = value;
  });
});

Widgets

Display a video playback area

VideoViewer()

Display the video trimmer area

TrimEditor(
  viewerHeight: 50.0,
  viewerWidth: MediaQuery.of(context).size.width,
  onChangeStart: (value) {
    _startValue = value;
  },
  onChangeEnd: (value) {
    _endValue = value;
  },
  onChangePlaybackState: (value) {
    setState(() {
      _isPlaying = value;
    });
  },
)

Example

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:video_trimmer/trim_editor.dart';
import 'package:video_trimmer/video_trimmer.dart';
import 'package:video_trimmer/video_viewer.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Trimmer',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  final Trimmer _trimmer = Trimmer();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Video Trimmer"),
      ),
      body: Center(
        child: Container(
          child: RaisedButton(
            child: Text("LOAD VIDEO"),
            onPressed: () async {
              File file = await ImagePicker.pickVideo(
                source: ImageSource.gallery,
              );
              if (file != null) {
                await _trimmer.loadVideo(videoFile: file);
                Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) {
                  return TrimmerView(_trimmer);
                }));
              }
            },
          ),
        ),
      ),
    );
  }
}

class TrimmerView extends StatefulWidget {
  final Trimmer _trimmer;
  TrimmerView(this._trimmer);
  @override
  _TrimmerViewState createState() => _TrimmerViewState();
}

class _TrimmerViewState extends State<TrimmerView> {
  double _startValue = 0.0;
  double _endValue = 0.0;

  bool _isPlaying = false;
  bool _progressVisibility = false;

  Future<String> _saveVideo() async {
    setState(() {
      _progressVisibility = true;
    });

    String _value;

    await widget._trimmer
        .saveTrimmedVideo(startValue: _startValue, endValue: _endValue)
        .then((value) {
      setState(() {
        _progressVisibility = false;
        _value = value;
      });
    });

    return _value;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Video Trimmer"),
      ),
      body: Builder(
        builder: (context) => Center(
          child: Container(
            padding: EdgeInsets.only(bottom: 30.0),
            color: Colors.black,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              mainAxisSize: MainAxisSize.max,
              children: <Widget>[
                Visibility(
                  visible: _progressVisibility,
                  child: LinearProgressIndicator(
                    backgroundColor: Colors.red,
                  ),
                ),
                RaisedButton(
                  onPressed: _progressVisibility
                      ? null
                      : () async {
                          _saveVideo().then((outputPath) {
                            print('OUTPUT PATH: $outputPath');
                            final snackBar = SnackBar(content: Text('Video Saved successfully'));
                            Scaffold.of(context).showSnackBar(snackBar);
                          });
                        },
                  child: Text("SAVE"),
                ),
                Expanded(
                  child: VideoViewer(),
                ),
                Center(
                  child: TrimEditor(
                    viewerHeight: 50.0,
                    viewerWidth: MediaQuery.of(context).size.width,
                    onChangeStart: (value) {
                      _startValue = value;
                    },
                    onChangeEnd: (value) {
                      _endValue = value;
                    },
                    onChangePlaybackState: (value) {
                      setState(() {
                        _isPlaying = value;
                      });
                    },
                  ),
                ),
                FlatButton(
                  child: _isPlaying
                      ? Icon(
                          Icons.pause,
                          size: 80.0,
                          color: Colors.white,
                        )
                      : Icon(
                          Icons.play_arrow,
                          size: 80.0,
                          color: Colors.white,
                        ),
                  onPressed: () async {
                    bool playbackState =
                        await widget._trimmer.videPlaybackControl(
                      startValue: _startValue,
                      endValue: _endValue,
                    );
                    setState(() {
                      _isPlaying = playbackState;
                    });
                  },
                )
              ],
            ),
          ),
        ),
      ),
    );
  }
}

License

Copyright (c) 2020 Souvik Biswas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

GitHub

https://github.com/sbis04/video_trimmer
Comments
  • 1. Trimmed video first seconds sometimes stuck

    Hi! First of all, I love this new package, While I was using it, I realized that sometimes the video is stuck in the first few seconds after it was trimmed (but the audio is still playing). I think that it is because of the FFmpeg command, but I'm not sure and couldn't find the exact reason.

    Reviewed by omercn18 at 2020-05-19 12:14
  • 2. download video couldn't generate thumbnail

    hi

    when I pick download video. below error occurs on iOS ( iPhone7 ) android works fine

    flutter: /private/var/mobile/Containers/Data/Application/09F51573-CA6E-49BA-A792-E7FEBF4A5F74/tmp/_talkv_woYgOXv7ml_zSU8dBVSYS00f6uxummnuk_talkv_high.mp4 couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x283f9c690 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

    Image

    https://helloworld43943.tumblr.com/image/649523710269767680

    thx for your effort πŸ˜‡

    Reviewed by yoonjiyong at 2021-04-26 10:49
  • 3. When I call the trimmer instance saveVideo, my real device app crashes

    When I ran this on my emulator it worked, but I ran it on my Samsung 10+ phone using Android 11 (API 30) it crashed the app. Please what's the issue. I'm using the 0.4.0 version

    Reviewed by zuruoke at 2021-05-12 08:27
  • 4. Minimum Android version

    Thanks for this great package, it will be very useful for the new trends related to Videos.

    I would like to know why the minimum version of Android is 24?

    I suppose it has to do with the FFmpeg package that requires a minimum version of android.

    Do you have a future plan to cover more versions until at least 23?

    I see that at level 23 is 16.9% of the devices with this version.

    I leave here the reference.

    distribution android version

    Reviewed by wilfredonoyola at 2020-06-11 13:03
  • 5. fatal error: 'mobileffmpeg/LogDelegate.h' file not found

    video_trimmer:0.3.4 I can compile and run normally, but flutter build IOS reports an error fatal error: 'mobileffmpeg/LogDelegate.h' file not found 'mobileffmpeg/ExecuteDelegate.h' file not found

    Reviewed by wangyan-png at 2021-07-02 09:53
  • 6. Because every version of flutter_test from sdk depends on path 1.8.0 and video_trimmer >=1.1.0 depends on path ^1.8.1, flutter_test from sdk is incompatible with video_trimmer >=1.1.0. So, because 'my app name 'depends on both video_trimmer ^1.1.1 and flutter_test from sdk, version solving failed. pub get failed (1; So, because 'my app name depends on both video_trimmer ^1.1.1 and flutter_test from sdk, version solving failed.)

    Because every version of flutter_test from sdk depends on path 1.8.0 and video_trimmer >=1.1.0 depends on path ^1.8.1, flutter_test from sdk is incompatible with video_trimmer >=1.1.0. So, because 'my app name depends on both video_trimmer ^1.1.1 and flutter_test from sdk, version solving failed. pub get failed (1; So, because 'my app name 'depends on both video_trimmer ^1.1.1 and flutter_test from sdk, version solving failed.)

    Reviewed by jack84156 at 2022-03-23 13:27
  • 7. Issue with video trimmer working code. Working code stopped working

    My working code of video trimmer stopped working and showing error . It was working fine earlier. Below is the screenshot of what it appears now. It was working all fine earlier. @sbis04 @themadmrj @domliang @ArjanAswal

    Screenshot 2022-01-01 at 10 31 42 PM

    and here is the pubspec for videos i have

    video_trimmer: ^1.0.0 ffmpeg_kit_flutter: ^4.5.0-LTS video_player: ^2.2.10 video_editor: ^1.2.2

    If i add ffmpeg_kit_flutter: git: url: https://github.com/shilangyu/ffmpeg-kit ref: development-flutter path: prebuilt/bundle-flutter-lts/default

    Then error comes. - Because myproject depends on video_trimmer ^1.0.0 which depends on ffmpeg_kit_flutter 4.5.0-LTS, ffmpeg_kit_flutter from hosted is required.

    and if version is downgraded then

    then its showing error on save

     _trimmer.saveTrimmedVideo(
          startValue: _startValue,
          endValue: _endValue,
          onSave: 
    
    Screenshot 2022-01-02 at 9 14 28 AM
    Reviewed by aditya-mahajan96 at 2022-01-02 02:23
  • 8. The app stops on : flutter run --release when saving the trimmed video

    I/flutter (15561): Formatted: Aug15,2021-09:09:43
    I/flutter (15561): Creating
    I/flutter (15561): Retrieved Trimmer folder
    I/flutter (15561): Start: 0:00:00.000000 & End: 0:00:01.820000
    I/flutter (15561): /data/user/0/com.example.videotrim/app_flutter/Trimmer/
    I/flutter (15561): OUTPUT: .mp4
    D/flutter-ffmpeg(15561): Running FFmpeg with arguments: [-ss, 0:00:00.000000, -i, /data/user/0/com.example.videotrim/cache/file_picker/VID-20210811-WA0002.mp4, -t, 0:00:01.820000, -avoid_negative_ts, make_zero, -c:a, copy, -c:v, copy, /data/user/0/com.example.videotrim/app_flutter/Trimmer/VID-20210811-WA0002_trimmed:Aug15,2021-09:09:43.mp4].
    E/AndroidRuntime(15561): FATAL EXCEPTION: AsyncTask #2
    E/AndroidRuntime(15561): Process: com.sosnetworks.maberrr, PID: 15561
    E/AndroidRuntime(15561): java.lang.RuntimeException: An error occurred while executing doInBackground()
    E/AndroidRuntime(15561): 	at android.os.AsyncTask$4.done(AsyncTask.java:399)
    E/AndroidRuntime(15561): 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
    E/AndroidRuntime(15561): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
    E/AndroidRuntime(15561): 	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
    E/AndroidRuntime(15561): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    E/AndroidRuntime(15561): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    E/AndroidRuntime(15561): 	at java.lang.Thread.run(Thread.java:919)
    E/AndroidRuntime(15561): Caused by: java.lang.UnsatisfiedLinkError: Bad JNI version returned from JNI_OnLoad in "/data/app/com.sosnetworks.maberrr-zOO2TvvEh9H3F0cpfVARtA==/base.apk!/lib/arm64-v8a/libmobileffmpeg.so": 0
    E/AndroidRuntime(15561): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
    E/AndroidRuntime(15561): 	at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
    E/AndroidRuntime(15561): 	at java.lang.System.loadLibrary(System.java:1667)
    E/AndroidRuntime(15561): 	at com.arthenica.mobileffmpeg.Config.<clinit>(Unknown Source:146)
    E/AndroidRuntime(15561): 	at com.arthenica.mobileffmpeg.Config.f(Unknown Source:0)
    E/AndroidRuntime(15561): 	at com.arthenica.mobileffmpeg.c.d(Unknown Source:2)
    E/AndroidRuntime(15561): 	at c.a.a.a.a.a(Unknown Source:31)
    E/AndroidRuntime(15561): 	at c.a.a.a.a.doInBackground(Unknown Source:2)
    E/AndroidRuntime(15561): 	at android.os.AsyncTask$3.call(AsyncTask.java:378)
    E/AndroidRuntime(15561): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    E/AndroidRuntime(15561): 	... 3 more
    Reviewed by kahdichienja at 2021-08-15 06:28
  • 9. Lost connection when I call _saveVideo() in iOS [^0.3.5]

    I think you can understand with only codes so...

    flutter doctor

    [βœ“] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale ko-KR) [βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [βœ“] Xcode - develop for iOS and macOS (Xcode 12.2) [!] Android Studio (version 4.1) βœ— Flutter plugin not installed; this adds Flutter specific functionality. βœ— Dart plugin not installed; this adds Dart specific functionality. [βœ“] Connected device (1 available) IPhone7

    -------------------------------------------------------------------------------------------

    loading images from gallery with file picker

            FilePickerResult result = await FilePicker.platform.pickFiles(
              type: FileType.video,
              allowCompression: false,
            );
    
            if (result != null) {
              File file = File(result.files.single.path);
              await _trimmer.loadVideo(videoFile: file);
              Navigator.of(context).push(
                MaterialPageRoute(builder: (context) {
                  return TrimVideoScreen(trimmer: _trimmer); βœ…
                }),
              );
    

    -------------------------------------------------------------------------------------------

    TrimVideoScreen βœ…

    ` class TrimVideoScreen extends StatefulWidget { final Trimmer trimmer; TrimVideoScreen({this.trimmer});

              @override
              _TrimVideoScreenState createState() => _TrimVideoScreenState();
            }
    
            class _TrimVideoScreenState extends State<TrimVideoScreen> {
              double _startValue = 0.0;
              double _endValue = 0.0;
    
              bool _isPlaying = false;
              bool _progressVisibility = false;
    
              Future<String> _saveVideo() async {
                setState(() {
                  _progressVisibility = true;
                });
                print('Came here πŸ˜€');
                String _value;
                try {            
                  print('Came here2 πŸ˜€');
                  await widget.trimmer βœ… Lost connection to device. in HERE ❌❌❌
                      .saveTrimmedVideo(startValue: _startValue, endValue: _endValue)
                      .then((value) {
                    setState(() {
                      _progressVisibility = false;
                      _value = value;
                    });
                  });
                } catch (e) {
                  print('Came here3 πŸ˜€');
                }
            
                return _value;
              }
    

    ...

            SaveVideo Button onPressed {
                            
            await _saveVideo().then( βœ…
              (outputPath) {
                print('OUTPUT PATH: $outputPath');
             },
            ).catchError((onError) {
              print('error is $onError');
            });
            }
    

    `

    -------------------------------------------------------------------------------------------

    LOG

    flutter: Came here πŸ˜€

    flutter: Came here2 πŸ˜€

    flutter: DateTime: Jan 7, 2021 - 15:50:59

    flutter: Formatted: Jan7,2021-15:50:59

    flutter: πŸ”οΈŽ TrimVideo Builded

    flutter: Exists

    flutter: Retrieved Trimmer folder

    flutter: Start: 0:00:00.000000 & End: 0:00:13.400000

    flutter: /var/mobile/Containers/Data/Application/92D5B540-6CDF-49CE-85D6-5F29B573833E/Documents/Trimmer/

    flutter: OUTPUT: .mp4

    Lost connection to device.

    -------------------------------------------------------------------------------------------

    PROCESS

    1. load trimmer with FilePicker
    2. go to TrimVideoScreen()
    3. after set start point , end point
    4. call _saveTrimmer to get trimmedUrl => ERROR OCCUS

    ------------------------------------------------------------------------------------------- I tried with TrimmerView Class its Same result when I click save Button it dies

    LOG

    flutter: DateTime: Jan 7, 2021 - 17:28:35 flutter: Formatted: Jan7,2021-17:28:35 flutter: Exists flutter: Retrieved Trimmer folder flutter: Start: 0:00:00.000000 & End: 0:00:13.400000 flutter: /var/mobile/Containers/Data/Application/7A2D57AF-E412-474F-A77D-0BFB5B167E74/Documents/Trimmer/ flutter: OUTPUT: .mp4 Lost connection to device.

    Help! πŸ˜…

    Reviewed by yoonjiyong at 2021-01-07 07:20
  • 10. Thumbnail images of video is not showing correctly?

    Hi,When I open videos the thumbnail images that come bottom are not loading correctly?Once the thumbnail loaded and suddenlt they skipped? Error:This an error shown below: "getFrameAtTime: videoFrame is a NULL pointer"

    Reviewed by ubaidsuhail at 2020-06-25 06:44
  • 11. Empty file in emulator but works on Real device...

    Pixel #3XL API 30 Flutter 2

    Future _saveVideo() async { setState(() { _progressVisibility = true; });

    String _value;
    
    await widget._trimmer
        .saveTrimmedVideo(startValue: _startValue, endValue: _endValue)
        .then((value) {
      setState(() {
        _progressVisibility = false;
        _value = value;
      });
    });
    
    return _value;
    

    }

    In emulator doesnt works but in real device works perfectly

    Reviewed by ajosecueto at 2021-03-10 22:55
  • 12. could i control the trimmer slider? like could i set the start and the end of the slider using this package?

    i do not want the trimming slider to take the video(Start and end) , i want to customize it using specific time interval ? it is possible using this package ?

    Reviewed by khaledmurtaja at 2022-07-29 15:53
  • 13. Video Trim issue from gallery pick

    When picking a video from gallery . Video Compress show file FileSystemException cannot Retrieve length of file path.

    Video Path is coming fine.

    While when loading a video from camera its working fine.

    void _loadVideo() async { print("widget.file.path ${widget.file}"); _trimmer.loadVideo(videoFile: widget.file); } Simulator Screen Shot - iPhone 13 - 2022-07-20 at 10 03 33

    Reviewed by expertdev-designer at 2022-07-18 14:23
  • 14. FFmpeg processing failed with custom ffmpeg command

    Hi, I am testing with physical device using version 1.1.3. I need to compress trimmed video , so I am using custom ffmpeg commands but the process fails. Here is my code and output. Code:

    await _trimmer.saveTrimmedVideo(
        startValue: _startValue,
        endValue: _endValue,
            customVideoFormat: '.mp4',
            ffmpegCommand: '-c:v libx265 -preset fast -crf 28',
            onSave: (val) {
              print('path: $val');
              setState(() {
                _progressVisibility = false;
              });
            });
    

    Output:

    I/flutter ( 9002): Exists I/flutter ( 9002): Retrieved Trimmer folder I/flutter ( 9002): Start: 0:00:00.000000 & End: 0:00:15.000000 I/flutter ( 9002): /data/user/0/<APP NAME>/app_flutter/Trimmer/ I/flutter ( 9002): OUTPUT: .mp4 I/flutter ( 9002): Loading ffmpeg-kit-flutter. D/ffmpeg-kit-flutter( 9002): FFmpegKitFlutterPlugin [email protected] started listening to events on io.flutter.plugin.common.Ev[email protected]23b73ab. I/flutter ( 9002): Loaded ffmpeg-kit-flutter-android-https-arm64-v8a-4.5.1. I/flutter ( 9002): FFmpeg process exited with state COMPLETED and rc 1 I/flutter ( 9002): FFmpeg processing failed. I/flutter ( 9002): Couldn't save the video I/flutter ( 9002): path: null

    Thanks for any help

    Reviewed by OrchiDorchi at 2022-07-15 11:00
  • 15. having error running for iOS

    [!] CocoaPods could not find compatible versions for pod "ffmpeg_kit_flutter/https": In Podfile: ffmpeg_kit_flutter (from .symlinks/plugins/ffmpeg_kit_flutter/ios) was resolved to 4.5.1, which depends on ffmpeg_kit_flutter/https (= 4.5.1)

    Specs satisfying the ffmpeg_kit_flutter/https (= 4.5.1) dependency were found, but they required a higher minimum deployment target.

    Reviewed by wanoghoco at 2022-07-06 21:52
  • 16. Saved video not having consistent duration in a loop

    My code, where increment factor is the fixed duration for each trimmed video.

    Example: If duration is set to 10 seconds then some of the saved outputs are having 11 seconds duration. where the extra 1 second is taken from the previous cut. The logs show correct Start and End values.

    double incrementFactor = (double.parse(_trimDuration.text) * 1000); try { for (double i = _start; i < _end; i += incrementFactor) { await _saveVideo(i, min(_end, i + incrementFactor), count: count); count++; } } catch (e) { LoadingDialog.dismissLoading(); debugPrint(e.toString()); }

    Future _saveVideo(double start, double end, {int? count = 1}) async { try { await _trimmer.saveTrimmedVideo( startValue: start, endValue: end, // applyVideoEncoding: true, outputFormat: FileFormat.mov, videoFolderName: _fileNameController.text, videoFileName: '${fileNameController.text}$count', storageDir: StorageDir.externalStorageDirectory, onSave: (outputPath) { debugPrint('OUTPUT PATH: $outputPath'); }, ); } catch (e) { debugPrint(e.toString()); } } Also the output of save is not in sync with loop order. Not able to find solution for this. Please help.

    Reviewed by anirudhraopn at 2022-06-21 16:30

Related

This is a flutter package of video player. it's a very simple and easy to use.
This is a flutter package of video player. it's a very simple and easy to use.

This is a flutter package of video player. it's a very simple and easy to use.

Aug 9, 2022
Official Flutter SDK for LiveKit. Easily add real-time video and audio to your Flutter apps.

LiveKit Flutter SDK Official Flutter SDK for LiveKit. Easily add real-time video and audio to your Flutter apps. This package is published to pub.dev

Aug 9, 2022
Flutter plugin for use Video.js in flutter web
Flutter plugin for use Video.js in flutter web

Flutter Video.js player Flutter plugin for use Video.js in flutter web Installation Add it to your package's pubspec.yaml file dependencies: video_j

Aug 9, 2022
The video player for Flutter with a heart of gold

chewie The video player for Flutter with a heart of gold. The video_player plugin provides low-level access to video playback. Chewie uses the video_p

Aug 11, 2022
Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Better video player for Flutter, with multiple configuration options. Solving typical use cases!

Better video player for Flutter, with multiple configuration options. Solving typical use cases!

Aug 11, 2022
video call with WebRTC and Flutter
video call with WebRTC and Flutter

Video Call Flutter App ?? Description: This is sandbox video call application using Flutter and WebRTC, you can call from browser to browser, phone to

Aug 13, 2022
A fully-functional video streaming app made in Flutter using Custom Nodejs backend.
A fully-functional video streaming app  made in Flutter using Custom Nodejs backend.

LAVENDER ?? A fully-functional video streaming app like netflix made in Flutter using Custom Nodejs backend. How To Run This Project ??‍♂️ Clone the r

Aug 8, 2022
Open source geo based video sharing social app created with Flutter, Supabase and lots of love πŸ’™πŸ’™πŸ’™
Open source geo based video sharing social app created with Flutter, Supabase and lots of love πŸ’™πŸ’™πŸ’™

Spot Take a virtual journey around the world with Spot. Spot is a geo-tagged video sharing app, meaning every video recorded in Spot is saved on a loc

Aug 11, 2022
Video call with WebRTC and Flutter
Video call with WebRTC and Flutter

This is sandbox video call application using Flutter and WebRTC, you can call from browser to browser, phone to phone, browser to phone and opposite.

Apr 27, 2022
Fleo - A video calling application developed using flutter🀠
Fleo - A video calling application developed using flutter🀠

Fleo ?? Video Calling Application developed using flutter Light and Dark Modes ?? Join using Room Codes ?? One room can accomodate upto 4 persons Powe

May 5, 2022
Advanced video player based on video_player and Chewie for flutter
Advanced video player based on video_player and Chewie for flutter

Better Player Advanced video player based on video_player and Chewie. It's solves many typical use cases and it's easy to run. Introduction This plugi

Dec 22, 2021
Sandbox video call application using Flutter and WebRTC
Sandbox video call application using Flutter and WebRTC

Video Call Flutter App ?? Description: This is sandbox video call application using Flutter and WebRTC, you can call from browser to browser, phone to

Apr 27, 2022
Base on Vap to play alpha video animation
Base on Vap to play alpha video animation

Backdrop Transparent video animation is currently one of the more popular implementations of animation. Major manufacturers have also open source

Jun 13, 2022
A cloudinatry video url sample project

cloudinary_media_sample A new Flutter project for Cloudinary video url. Getting Started This project is a starting point for a Flutter application. A

Nov 4, 2021
A simple video streaming application made with Dart, JavaScript, HTML, CSS
A simple video streaming application made with Dart, JavaScript, HTML, CSS

streamZ A simple video streaming application made with Dart, JS, HTML, CSS & ❀️ Show some ❀️ by putting ⭐ Recently I wrote an article, explaining how

Nov 23, 2021
A view for video based on video_player and provides many basic functions.

flutter_video_view A view for video based on video_player and provides many basic functions. Getting Started This project is a starting point for a Fl

Jun 22, 2022
A flutter package for iOS and Android for applying filter to an image
A flutter package for iOS and Android for applying filter to an image

Photo Filters package for flutter A flutter package for iOS and Android for applying filter to an image. A set of preset filters are also available. Y

Oct 26, 2021
Flutter package for creating a fully customizable and editable image widget.
Flutter package for creating a fully customizable and editable image widget.

EditableImage Flutter Package Flutter package for creating a fully customizable and editable image widget. The package has been written solely in Dart

Jun 13, 2022
A lightweight flutter package to simplify the creation of a miniplayer.
A lightweight flutter package to simplify the creation of a miniplayer.

A lightweight flutter package to simplify the creation of a miniplayer by providing a builder function with the current height and percentage progress

Aug 4, 2022