0

I'm working on simple flutter video converting app, its returning with 'Conversion Failed'. here is my code.

Directory tempDir = await getTemporaryDirectory();
    String timestamp = DateTime.now().millisecondsSinceEpoch.toString();
    String outputPath = "${tempDir.path}/$timestamp.mp4";

    String command =
        '-i $_videoPath -vf "scale=$vidWidth:$vidHeight" -c:v libx264 -crf 23 $outputPath';

    await FFmpegKit.executeAsync(command, (session) async {
      final returnCode = await session.getReturnCode();
      print('................... $returnCode');
      if (returnCode == 1) {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text('Video Saved')));
        await GallerySaver.saveVideo(outputPath);
      } else {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text('Conversion Failed')));
      }
    });

I use flutter_ffmpeg which was working fine. but its not working with FFmpegKit,

mortalis
  • 2,060
  • 24
  • 34
Nasir
  • 1
  • `FFmpegKit` should have a `Config` class with `setLogLevel` method, use it to set debug level, and check you Logcat output, maybe change it to debug also, to see more info about the error. – mortalis Aug 30 '23 at 16:02

0 Answers0