这是代码片段
String[] ffmpegCommand = new String[5];
ffmpegCommand[0] = "/mnt/sdcard/com.ffmpeg_test/ffmpeg";
ffmpegCommand[1] = "-i";
ffmpegCommand[2] = "concat:/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_22.mp4|/mnt/sdcard/com.ffmpeg_test/VID_3_25_2013_12_28.mp4";
ffmpegCommand[3] = "copy";
ffmpegCommand[4] = "/mnt/sdcard/com.ffmpeg_test/output.mp4";
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();
}
我不知道如何处理可执行的 ffmpeg 命令。“/mnt/sdcard/com.ffmpeg_test/ffmpeg”;ffmeg 附带源代码并内置在共享库 libffmpeg.so 中,但没有任何地方是 ffmpeg 可执行命令文件。有任何想法吗?