sbis04 / video_trimmer

Flutter video trimmer package
https://pub.dev/packages/video_trimmer
MIT License
441 stars 272 forks source link

FFmpeg processing failed with custom ffmpeg command #169

Closed OrchiDorchi closed 1 year ago

OrchiDorchi commented 2 years ago

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 com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin@3066d69 started listening to events on io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler$EventSinkImplementation@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

sbis04 commented 2 years ago

Not sure about the exact command to compress, but I think the easier way would be using video_compress package.