File:: Protocol not found E/mobile-ffmpeg(16657): Did you mean file:File:?

121 views Asked by At

here is the code for file name initialization and video to audio conversion through ffmpeg

Directory direc = (await getApplicationDocumentsDirectory());
Directory directory = Directory(direc.path+"/check");
print(directory.path);
  String command = "-i input_video.mp4 -vn -acodec copy output_audio.mp3";
  print(HomePage.pickedvideo);
  File file = File(directory.path+"/out.mp3");
  print(file);
  print(HomePage.pickedvideo);

    final FlutterFFmpeg FFmpeg = FlutterFFmpeg();
    FFmpeg.execute("ffmpeg -i ${HomePage.pickedvideo}"
        " -map 0:a "
        "-acodec ${file}")
        .then((rc)=>{
      print("FFmpeg process exited with rc $rc")
    });

This code is causing error

File:: Protocol not found Did you mean file:File:?

how can i solve it?

1

There are 1 answers

2
B14ck On

can u try this code ?


Directory directory = Directory((await getApplicationDocumentsDirectory()).path + "/check");

String inputFilePath = HomePage.pickedvideo;
String outputFilePath = "${directory.path}/out.mp3";

final FlutterFFmpeg FFmpeg = FlutterFFmpeg();
FFmpeg.execute(
  "ffmpeg -i $inputFilePath -map 0:a -acodec copy $outputFilePath"
).then((rc) => print("FFmpeg process exited with rc $rc"));