Convert PPTX to video in Java

Powerful cross-platform Java API for converting PowerPoint to video using Java code

Convert PowerPoint to video using Aspose.Slides

Aspose.Slides for Java is a powerful Java library used to create, edit and manipulate presentations and also convert PowerPoint presentations to other documents and videos. In this case, to convert PowerPoint to video, you need to use Aspose.Slides alongside ffmpeg.

This is how the PPTX to video conversion process works: Aspose.Slides is used to generate a set of frames (from the presentation slides) and then FFMpegCore (ffmpeg) is used to create a video based on the frames.

How to convert PPTX to video

  1. Install Aspose.Slides for Java by following the instructions here . Download ffmpeg here.

  2. Add this to your POM file:


  3. Copy, paste, and then run the Java PowerPoint to video code.

Convert PowerPoint to video in Java

Use this Java code to convert PPTX to video:

Java code for converting PowerPoint to video

Presentation presentation = new Presentation();
try {
    // Adds a smile shape and then animates it
    IAutoShape smile = presentation.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.SmileyFace, 110, 20, 500, 500);
    ISequence mainSequence = presentation.getSlides().get_Item(0).getTimeline().getMainSequence();
    IEffect effectIn = mainSequence.addEffect(smile, EffectType.Fly, EffectSubtype.TopLeft, EffectTriggerType.AfterPrevious);
    IEffect effectOut = mainSequence.addEffect(smile, EffectType.Fly, EffectSubtype.BottomRight, EffectTriggerType.AfterPrevious);

    final int fps = 33;
    ArrayList<String> frames = new ArrayList<String>();

    PresentationAnimationsGenerator animationsGenerator = new PresentationAnimationsGenerator(presentation);
        PresentationPlayer player = new PresentationPlayer(animationsGenerator, fps);
        try {
            player.setFrameTick((sender, arguments) ->
                try {
                    String frame = String.format("frame_%04d.png", sender.getFrameIndex());
                    ImageIO.write(arguments.getFrame(), "PNG", new;
                } catch (IOException e) {
                    throw new RuntimeException(e);
        } finally {
            if (player != null) player.dispose();
    } finally {
        if (animationsGenerator != null) animationsGenerator.dispose();

    // Configure ffmpeg binaries folder. See this page:
    FFmpeg ffmpeg = new FFmpeg("path/to/ffmpeg");
    FFprobe ffprobe = new FFprobe("path/to/ffprobe");

    FFmpegBuilder builder = new FFmpegBuilder()
            .addExtraArgs("-start_number", "1")

    FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);
} catch (IOException e) {

Other Supported Conversions

You can also convert PowerPoint to files in other formats