Hi, Team
In PPTX, my animations occur simultaneously, but after exporting the video, the animations in the video appear one by one.
My Java Code:
public static void make_video_frame(String pptx_path, String save_png_dir) {
System.out.println("run make video frame");
final int fps = 60;
Presentation presentation = new Presentation(pptx_path);
PresentationAnimationsGenerator animationsGenerator = null;
try {
animationsGenerator = new PresentationAnimationsGenerator(presentation);
PresentationPlayer player = null;
try {
player = new PresentationPlayer(animationsGenerator, fps);
player.setFrameTick((sender, arguments) ->
{
try {
String frame = String.format("%s/frame_%04d.png", save_png_dir, sender.getFrameIndex());
ImageIO.write(arguments.getFrame(), "PNG", new java.io.File(frame));
} catch (IOException e) {
throw new RuntimeException(e);
}
});
animationsGenerator.run(presentation.getSlides());
} finally {
if (player != null) player.dispose();
}
} finally {
if (animationsGenerator != null) animationsGenerator.dispose();
}
}
Please refer to the attachment for the pptx file
10.zip (766.5 KB)
.