如何使用FFMPEG NDK库解码音频文件? 下面是合并两个mp3文件后我用来解码mp3文件的代码。 试试{
String tempPath = Environment.getExternalStorageDirectory()+"/"+mvalue+".mp3";
File fileTemp = new File(tempPath);
ffmpeg = new FfmpegController(fileTemp,outFile);
Clip clipMixOut = new Clip(outFile.getCanonicalPath());
try {
ffmpeg.convertToMPEG(clipMixOut,mCodecPath, new ShellUtils.ShellCallback() {
@Override
public void shellOut(String shellLine) {
// TODO Auto-generated method stub
System.out.println("fc>" + shellLine);
}
@Override
public void processComplete(int exitValue) {
// TODO Auto-generated method stub
System.err.println("concat non-zero exit: " + exitValue);
}
});
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e) {
Log.e(TAG+":::", "IOException running ffmpeg" + e.getMessage());
}
答案 0 :(得分:1)
我通过重新生成SO文件解决了这个问题。然后通过调用:
一切正常process.exec("ffmpeg cmd");