Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android中执行FFmpeg命令_Android_Video_Ffmpeg - Fatal编程技术网

在android中执行FFmpeg命令

在android中执行FFmpeg命令,android,video,ffmpeg,Android,Video,Ffmpeg,我在android项目中编译了所有的ffmpeg文件,但我不知道如何调用ffmpeg命令。如何获取已编译库的“可执行”文件?到底是什么? 谢谢 请尝试以下代码: try { Process ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start(); String line; BufferedReader reader = new BufferedR

我在android项目中编译了所有的ffmpeg文件,但我不知道如何调用ffmpeg命令。如何获取已编译库的“可执行”文件?到底是什么? 谢谢

请尝试以下代码:

 try {
      Process ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start();

      String line;
      BufferedReader reader = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream()));
      Log.d(null, "*******Starting FFMPEG");

      while((line = reader.readLine())!=null){

          Log.d(null, "***"+line+"***"); 
      }
      Log.d(null,"****ending FFMPEG****");

} catch (IOException e) {
    e.printStackTrace(); }
请尝试以下代码:

 try {
      Process ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start();

      String line;
      BufferedReader reader = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream()));
      Log.d(null, "*******Starting FFMPEG");

      while((line = reader.readLine())!=null){

          Log.d(null, "***"+line+"***"); 
      }
      Log.d(null,"****ending FFMPEG****");

} catch (IOException e) {
    e.printStackTrace(); }

谢谢我试试看!!字符串ffmpegCommand=“ffmpeg-i”+path.getAbsolutePath()+”/test/1.mp4-f avi-acodec mp3“+path.getAbsolutePath()+”/Songss.avi”;我在您的示例中传递ffmpegcommand,给出以下代码执行的错误IOException Working directory null IOException。好的,我刚刚在您的问题中回答了这个问题。windows操作系统32位中打开了ffmpeg库。ffmpeg库没有构建。请帮助我如何做。我也得到了Working directory null exception。如何解决它?谢谢!!我试试看!!字符串ffmpegCommand=“ffmpeg-i”+path.getAbsolutePath()+”/test/1.mp4-f avi-acodec mp3“+path.getAbsolutePath()+”/Songss.avi”;我在您的示例中传递ffmpegcommand,给出以下代码执行的错误IOException Working directory null IOException。好的,我刚刚在您的问题中回答了这个问题,windows操作系统32位中打开了ffmpeg库。ffmpeg库没有构建。请帮助我如何做。我也得到了Working directory null exception。如何解决它?