# Installing and using FFmpeg with VTK9.1.0

**URL:** https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803
**Category:** Support
**Created:** [June 24, 2022, 12:21pm UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803 "2022-06-24T12:21:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![vyvex](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@vyvex](https://discourse.vtk.org/u/vyvex)
#### Post date: [June 24, 2022, 12:21pm UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/1 "2022-06-24T12:21:50Z")

</div>

Hello everyone,  
i am trying to use ffmpeg to export a video of a data visualisation i’ve written but so far i have not been successful in getting vtk to be able to use ffmpeg.  
I am using Ubuntu 22.04 LTS and VTK9.1.0.

I’ve tried to follow [this older example](https://kitware.github.io/vtk-examples/site/Cxx/Video/FFMPEG/) for setting up ffmpeg with VTK but have not been able to make the linked tarball, because it is not able to find the VTK installation even if pointed there. Additionally the option to set VTK\_USE\_FFMPEG\_ENCODER ON when making VTK seems to be missing.

Making and installing ffmpeg from the official repository worked fine but does not seem to be able to integrate with VTK from my attempts.

Lastly i have tried to install ffmpeg from the [VTK downloads page](https://vtk.org/download/) but were not able to follow the README because the cvs commands return connection errors i have not been able to solve because of my limited experience with cvs. Furthermore making the included ffmpeg directory does not work because of a compilation error.

Any advice on how to resolve my problems to get ffmpeg to play along with VTK or alternatively other methods to be able to export a simple video of the rendered frames?  
Thanks in advance

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 24, 2022, 1:03pm UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/2 "2022-06-24T13:03:11Z")

</div>

> [@vyvex](#):
>
> does not seem to be able to integrate with VTK from my attempts.

What did you try? What were the results?

You should just need to enable the `VTK::IOFFMPEG` module and satisfy the `find_package(FFMPEG)` that is called in there.

---

<div class="post-metadata">

### Author: ![vyvex](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@vyvex](https://discourse.vtk.org/u/vyvex)
#### Post date: [June 24, 2022, 1:12pm UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/3 "2022-06-24T13:12:40Z")

</div>

Following the first example linked with the corresponding CMakeLists file i tried to just  
`#include <vtkFFMPEGWriter.h>` which already throws an error because that file cannot be found.  
I guess it would exist, if i could build VTK with the configuration option of VTK\_USE\_FFMPEG\_ENCODER ON but that doesn’t seem to exist (anymore?).

I’m sorry if i might be making very obvious mistakes but this got me stuck as i am very new to developing on linux and with cmake.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 24, 2022, 5:06pm UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/4 "2022-06-24T17:06:29Z")

</div>

You need to build VTK with the named module enabled. `VTK_MODULE_ENABLE_VTK_IOFFMPEG` should be the option name.

---

<div class="post-metadata">

### Author: ![vyvex](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@vyvex](https://discourse.vtk.org/u/vyvex)
#### Post date: [June 25, 2022, 2:30pm UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/5 "2022-06-25T14:30:20Z")

</div>

Unless there are more options hidden somewhere which i have not found yet, these are all the options available to me when configuring with ccmake following the instructions on the [wiki](https://vtk.org/Wiki/VTK/Configure_and_Build)

 ![vtk all options](https://discourse.vtk.org/uploads/default/original/2X/f/f6d5c29855f4ec002bf1a5bd93342aefc58121e6.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 28, 2022, 12:12am UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/6 "2022-06-28T00:12:17Z")

</div>

You can hit `t` to toggle showing “advanced” variables.

---

<div class="post-metadata">

### Author: ![vyvex](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@vyvex](https://discourse.vtk.org/u/vyvex)
#### Post date: [June 28, 2022, 10:09am UTC](https://discourse.vtk.org/t/installing-and-using-ffmpeg-with-vtk9-1-0/8803/7 "2022-06-28T10:09:58Z")

</div>

Thank you very much. Turns out there actually were hidden variables 🙂
