Installing and using FFmpeg with VTK9.1.0

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 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 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

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.

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.

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

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

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

1 Like

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