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
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.
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)) {
} else if (ReturnCode.isCancel(returnCode)) {
} else {
}
});