在android中执行FFmpeg命令
我在android项目中编译了所有的ffmpeg文件,但我不知道如何调用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
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。如何解决它?