# Convert PPTX to Video in C++

> Convert PPTX to video in C++. Use Aspose.Slides for C++ with ffmpeg to render PowerPoint slides to video frames and create a video file.

Source: https://products.aspose.com/slides/cpp/conversion/pptx-to-video/
Updated: 2026-07-09



## Convert PowerPoint to Video Using Aspose.Slides

[Aspose.Slides for C++](/slides/cpp/) can render PowerPoint presentations to image frames. To create a video, render frames with `PresentationAnimationsGenerator` and `PresentationPlayer`, then pass those frames to `ffmpeg`.

## How to Convert PPTX to Video

Install `Aspose.Slides for C++` from [NuGet](https://www.nuget.org/packages/Aspose.Slides.Cpp/) or the [releases page](https://releases.aspose.com/slides/cpp/), and install `ffmpeg` from the [ffmpeg download page](https://ffmpeg.org/download.html).

Add `ffmpeg.exe` to the `PATH` environment variable.

Run the C++ code to render PPTX frames and create an MP4 video.

## Convert PowerPoint to Video in C++

Use this C++ code to convert PPTX to video:

### PPTX to Video C++ Conversion Source Code

```cpp
void SaveFrame(System::SharedPtr<PresentationPlayer> presentationPlayer, System::SharedPtr<FrameTickEventArgs> eventArguments)
{
    auto frameFileName = String::Format(u"frame_{0}.png", presentationPlayer->get_FrameIndex());
    eventArguments->GetFrame()->Save(frameFileName);
}

void Run()
{
    auto presentation = MakeObject<Presentation>(u"presentation.pptx");

    const int framesPerSecond = 33;
    auto animationsGenerator = MakeObject<PresentationAnimationsGenerator>(presentation);
    auto player = MakeObject<PresentationPlayer>(animationsGenerator, framesPerSecond);
    player->FrameTick += SaveFrame;

    animationsGenerator->Run(presentation->get_Slides());

    auto ffmpegParameters = String::Format(
        u"-loglevel {0} -framerate {1} -i {2} -y -c:v {3} -pix_fmt {4} {5}",
        u"warning", framesPerSecond, u"frame_%d.png", u"libx264", u"yuv420p", u"video.mp4");
    auto ffmpegProcess = Process::Start(u"ffmpeg", ffmpegParameters);
    ffmpegProcess->WaitForExit();

    presentation->Dispose();
}
```

## Other Supported Conversions

- [PPTX TO PDF](/slides/cpp/conversion/pptx-to-pdf/)
- [PPTX TO WORD](/slides/cpp/conversion/pptx-to-word/)
- [PPTX TO HTML](/slides/cpp/conversion/pptx-to-html/)
- [PPTX TO JPEG](/slides/cpp/conversion/pptx-to-jpeg/)
- [PPTX TO PNG](/slides/cpp/conversion/pptx-to-png/)
- [PPTX TO SVG](/slides/cpp/conversion/pptx-to-svg/)
- [PPTX TO BMP](/slides/cpp/conversion/pptx-to-bmp/)
- [PPTX TO EMF](/slides/cpp/conversion/pptx-to-emf/)
- [PPTX TO GIF](/slides/cpp/conversion/pptx-to-gif/)
