Feature: add video transition

pull/221/head
xufuji456 2 years ago
parent 351b79658b
commit e8ef428180
  1. 8
      app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java

@ -845,4 +845,12 @@ public class FFmpegUtil {
return insert(stereo3dCmd.split(" "), 2, inputPath, outputPath);
}
public static String[] videoTransition(String inputPath1, int width, int height, int offset, String inputPath2, String outputPath) {
String transitionCmd = "ffmpeg -i -i -filter_complex " +
"[0]settb=AVTB,fps=24000/1001[v0];[1]settb=AVTB,fps=24000/1001,scale=%d:%d[v1];" +
"[v0][v1]xfade=transition=radial:duration=1:offset=%d";
transitionCmd = String.format(Locale.getDefault(), transitionCmd, width, height, offset);
return insert(transitionCmd.split(" "), 2, inputPath1, 4, inputPath2, outputPath);
}
}

Loading…
Cancel
Save