这工作正常。在 Moto G4、nexus 7 和 sony XA DUAL 上测试。
private void execFFmpegBinaryShortest(final String[] command) {
final File outputFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/slideShowMusic/"+"Vid"+"output"+i1+".mp4");
String[] cmd = new String[]{ "-y", "-i", slideVid, "-i", sdPath ,"-filter_complex", "[1][0]scale2ref[i][m];[m][i]overlay[v]" ,"-map", "[v]", "-map", "0:a?", "-ac", "2", outputFile.getPath()};
try {
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onFailure(String s) {
System.out.println("on failure----"+s);
}
@Override
public void onSuccess(String s) {
System.out.println("on success-----"+s);
}
@Override
public void onProgress(String s) {
//Log.d(TAG, "Started command : ffmpeg "+command);
System.out.println("Started---"+s);
mBtnNext.setText("Converting-->"+s);
}
@Override
public void onStart() {
//Log.d(TAG, "Started command : ffmpeg " + command);
System.out.println("Start----");}
@Override
public void onFinish() {
System.out.println("Finish-----");
Intent i = new Intent(imageOverlay.this, addAudio.class);
System.out.println("!!!!!!!!"+outputFile);
i.putExtra("slideVid",outputFile.getPath());
startActivity(i);
}
});
} catch (FFmpegCommandAlreadyRunningException e) {
// do nothing for now
System.out.println("exceptio :::"+e.getMessage());
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句