Convert PowerPoint to Video

By converting your PowerPoint presentation to video, you get

  • Increase in accessibility: All devices (regardless of platform) are equipped with video players by default compared to presentation-opening applications, so users find it easier to open or play videos.
  • More reach: Through videos, you can reach a large audience and target them with information that might otherwise seem tedious in a presentation. Most surveys and statistics suggest that people watch and consume videos more than other forms of content, and they generally prefer such content.

PowerPoint to Video Conversion in Aspose.Slides

In Aspose.Slides 24.4, we implemented support for presentation to video conversion.

  • Use Aspose.Slides to generate a set of frames (from the presentation slides) that correspond to a certain FPS (frames per second)
  • Use a third-party utility like ffmpeg to create a video based on the frames.

Convert PowerPoint to Video

  1. Use the pip install command to add Aspose.Slides to your project:
    • run pip install Aspose.Slides==24.4.0
  2. Download ffmpeg here or install via package manager.
  3. Make sure that ffmpeg is in the PATH, otherwise launch ffmpeg using full path to binary (e.g. C:\ffmpeg\ffmpeg.exe on Windows or /opt/ffmpeg/ffmpeg on Linux)
  4. Run the PowerPoint to video code.

This Python code shows you how to convert a presentation (containing a figure and two animation effects) to a video:

import aspose.slides as slides
import subprocess

with slides.Presentation() as presentation:
    smile = presentation.slides[0].shapes.add_auto_shape(slides.ShapeType.SMILEY_FACE, 110, 20, 500, 500)
    effect_in = presentation.slides[0].timeline.main_sequence.add_effect(smile, slides.animation.EffectType.FLY, slides.animation.EffectSubtype.TOP_LEFT, slides.animation.EffectTriggerType.AFTER_PREVIOUS)
    effect_out = presentation.slides[0].timeline.main_sequence.add_effect(smile, slides.animation.EffectType.FLY, slides.animation.EffectSubtype.BOTTOM_RIGHT, slides.animation.EffectTriggerType.AFTER_PREVIOUS)
    effect_in.timing.duration = 2
    effect_out.preset_class_type = slides.animation.EffectPresetClassType.EXIT

    fps = 33
    with slides.export.PresentationEnumerableFramesGenerator(presentation, fps) as frames_stream:
        for frame_args in frames_stream.enumerate_frames(presentation.slides):
            frame = "frame_{:04d}.png".format(frame_args.frames_generator.frame_index)
            frame_args.get_frame().save(frame)

    cmd_line = ["ffmpeg", "-r", str(fps), "-i", "frame_%04d.png", "-y", "-s", "720x540", "-pix_fmt", "yuv420p", "smile.webm"]
    subprocess.call(cmd_line)

Video Effects

You can apply animations to objects on slides and use transitions between slides.

Animations and transitions make slideshows more engaging and interesting — and they do the same thing for videos. Let’s add another slide and transition to the code for the previous presentation:

import aspose.pydrawing as drawing
# Adds a smile shape and animates it
# ...
# Adds a new slide and animated transition

new_slide = presentation.slides.add_empty_slide(presentation.slides[0].layout_slide)
new_slide.background.type = slides.BackgroundType.OWN_BACKGROUND
new_slide.background.fill_format.fill_type = slides.FillType.SOLID
new_slide.background.fill_format.solid_fill_color.color = drawing.Color.indigo
new_slide.slide_show_transition.type = slides.TransitionType.PUSH

Aspose.Slides also supports animation for texts. So we animate paragraphs on objects, which will appear one after the other (with the delay set to a second):

import aspose.slides as slides
import subprocess

with slides.Presentation() as presentation:
    # Adds text and animations
    auto_shape = presentation.slides[0].shapes.add_auto_shape(slides.ShapeType.RECTANGLE, 210, 120, 300, 300)
    para1 = slides.Paragraph()
    para1.portions.add(slides.Portion("Aspose Slides for .NET"))
    para2 = slides.Paragraph()
    para2.portions.add(slides.Portion("convert PowerPoint Presentation with text to video"))

    para3 = slides.Paragraph()
    para3.portions.add(slides.Portion("paragraph by paragraph"))
    auto_shape.text_frame.paragraphs.add(para1)
    auto_shape.text_frame.paragraphs.add(para2)
    auto_shape.text_frame.paragraphs.add(para3)
    auto_shape.text_frame.paragraphs.add(slides.Paragraph())

    effect = presentation.slides[0].timeline.main_sequence.add_effect(para1, slides.animation.EffectType.APPEAR, slides.animation.EffectSubtype.NONE, slides.animation.EffectTriggerType.AFTER_PREVIOUS)

    effect2 = presentation.slides[0].timeline.main_sequence.add_effect(para2, slides.animation.EffectType.APPEAR, slides.animation.EffectSubtype.NONE, slides.animation.EffectTriggerType.AFTER_PREVIOUS)

    effect3 = presentation.slides[0].timeline.main_sequence.add_effect(para3, slides.animation.EffectType.APPEAR, slides.animation.EffectSubtype.NONE, slides.animation.EffectTriggerType.AFTER_PREVIOUS)

    effect4 = presentation.slides[0].timeline.main_sequence.add_effect(para3, slides.animation.EffectType.APPEAR, slides.animation.EffectSubtype.NONE, slides.animation.EffectTriggerType.AFTER_PREVIOUS)

    effect.timing.trigger_delay_time = 1
    effect2.timing.trigger_delay_time = 1
    effect3.timing.trigger_delay_time = 1
    effect4.timing.trigger_delay_time = 1

    # Converts frames to video
    fps = 33
    with slides.export.PresentationEnumerableFramesGenerator(presentation, fps) as frames_stream:
        for frame_args in frames_stream.enumerate_frames(presentation.slides):
            frame = "frame_{:04d}.png".format(frame_args.frames_generator.frame_index)
            frame_args.get_frame().save(frame)

    cmd_line = ["ffmpeg", "-r", str(fps), "-i", "frame_%04d.png", "-y", "-s", "720x540", "-pix_fmt", "yuv420p", "text_animation.webm"]
    subprocess.call(cmd_line)

Video Conversion Classes

To allow you to perform PowerPoint to video conversion tasks, Aspose.Slides provides the PresentationEnumerableAnimationsGenerator.

PresentationEnumerableAnimationsGenerator allows you to set the frame size for the video (that will be created later) and FPS value (frames per second) through its constructor. If you pass an instance of the presentation, Presentation.SlideSize will be used.

To make all animations in a presentation play at once, use PresentationEnumerableAnimationsGenerator.enumerate_frames method. This method takes a collection of slides and allows to sequentially obtain EnumerableFrameArgs. Then, EnumerableFrameArgs.get_frame() allows you to get video frame:

import aspose.slides as slides

with slides.Presentation("animated.pptx") as presentation:
    fps = 33
    with slides.export.PresentationEnumerableFramesGenerator(presentation, fps) as frames_stream:
        for frame_args in frames_stream.enumerate_frames(presentation.slides):
            frame_args.get_frame().save(f"frame_{frame_args.frames_generator.frame_index:04d}.png")

Then the generated frames can be compiled to produce a video. See the Convert PowerPoint to Video section.

Supported Animations and Effects

Entrance:

Animation Type Aspose.Slides PowerPoint
Appear not supported supported
Fade supported supported
Fly In supported supported
Float In supported supported
Split supported supported
Wipe supported supported
Shape supported supported
Wheel supported supported
Random Bars supported supported
Grow & Turn not supported supported
Zoom supported supported
Swivel supported supported
Bounce supported supported

Emphasis:

Animation Type Aspose.Slides PowerPoint
Pulse not supported supported
Color Pulse not supported supported
Teeter supported supported
Spin supported supported
Grow/Shrink not supported supported
Desaturate not supported supported
Darken not supported supported
Lighten not supported supported
Transparency not supported supported
Object Color not supported supported
Complementary Color not supported supported
Line Color not supported supported
Fill Color not supported supported

Exit:

Animation Type Aspose.Slides PowerPoint
Disappear not supported supported
Fade supported supported
Fly Out supported supported
Float Out supported supported
Split supported supported
Wipe supported supported
Shape supported supported
Random Bars supported supported
Shrink & Turn not supported supported
Zoom supported supported
Swivel supported supported
Bounce supported supported

Motion Paths:

Animation Type Aspose.Slides PowerPoint
Lines supported supported
Arcs supported supported
Turns supported supported
Shapes supported supported
Loops supported supported
Custom Path supported supported

Supported Slide Transition Effects

Subtle:

Animation Type Aspose.Slides PowerPoint
Morph not supported supported
Fade supported supported
Push supported supported
Pull supported supported
Wipe supported supported
Split supported supported
Reveal not supported supported
Random Bars supported supported
Shape not supported supported
Uncover not supported supported
Cover supported supported
Flash supported supported
Strips supported supported

Exciting:

Animation Type Aspose.Slides PowerPoint
Fall Over not supported supported
Drape not supported supported
Curtains not supported supported
Wind not supported supported
Prestige not supported supported
Fracture not supported supported
Crush not supported supported
Peel Off not supported supported
Page Curl not supported supported
Airplane not supported supported
Origami not supported supported
Dissolve supported supported
Checkerboard not supported supported
Blinds not supported supported
Clock supported supported
Ripple not supported supported
Honeycomb not supported supported
Glitter not supported supported
Vortex not supported supported
Shred not supported supported
Switch not supported supported
Flip not supported supported
Gallery not supported supported
Cube not supported supported
Doors not supported supported
Box not supported supported
Comb not supported supported
Zoom supported supported
Random not supported supported

Dynamic Content:

Animation Type Aspose.Slides PowerPoint
Pan not supported supported
Ferris Wheel supported supported
Conveyor not supported supported
Rotate not supported supported
Orbit not supported supported
Fly Through supported supported