skip to Main Content

final escapedOverlayText = overlayText.replaceAll(”’, ”’);
final command =
‘-i $videoPath -vf "drawtext=text=’$escapedOverlayText’:x=10:y=10:fontsize=24:fontcolor=white" -c:a copy $outputPath’;

  print('Executing command: $command');

  final session = await FFmpegKit.execute(command);
  final returnCode = await session.getReturnCode();
  print('here is errror Return code: $returnCode');

that those section of code where this ffmpeg returns the following error
I/flutter ( 6329): here is errror Return code: 1
I/flutter ( 6329): FFmpeg failed with return code: 1

i am trying to save the video with overlay text data in the gallery.

2

Answers


  1. Chosen as BEST ANSWER

    i have used this package and everything as you mentioned in answer but for me the main issue arrived in command. final command = '-i $videoPath -vf "drawtext=text='$escapedOverlayText':x=10:y=H-th-10:fontsize=24:fontcolor=white:shadowcolor=black:shadowx=2:shadowy=2" -c:a copy $outputPath';

    final session = await FFmpegKit.execute(command); <<< this command not run and gives the returncode error 1.


  2. I suggest you read main documents and then execute codes
    check this link
    https://pub.dev/packages/ffmpeg_kit_flutter

    and use this codes to execute it

    import ‘package:ffmpeg_kit_flutter/ffmpeg_kit.dart’;

    FFmpegKit.execute(‘-i file1.mp4 -c:v mpeg4 file2.mp4’).then((session) async {
    final returnCode = await session.getReturnCode();

    if (ReturnCode.isSuccess(returnCode)) {

    // SUCCESS
    

    } else if (ReturnCode.isCancel(returnCode)) {

    // CANCEL
    

    } else {

    // ERROR
    

    }
    });

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search