CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Paraview 3.12 - How to compile with ffmpeg for animation (

tunkers January 17, 2012 00:08

Paraview 3.12 - How to compile with ffmpeg for animation
Hello, In the previous version of OpenFoam 1.7.1 and paraview 3.8, I could easily create an animation of my results in AVI format.

I have recently upgraded to OpenFoam 2.1.0 / Paraview 3.12. Now when I try to save an animation in paraview, the only options are jpg, png, tif. There is no option for AVI. However Paraview does create a whole series of jpgs in the case folder.

I think I need to recompile paraview with ffmpeg support. I already have ffmpeg installed. In the file


I changed the following line to TRUE:

OPTION (VTK_USE_FFMPEG_ENCODER "If the FFMPEG library is available, should VTK use it for saving .avi animation files?" TRUE)

but now I'm getting a compilation error when I rebuild paraview:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
  used as include directory in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO

-- Configuring incomplete, errors occurred!

Now the problem is that I'm not sure where to set these variables that point to ffmpeg. Can someone give me a hint?



anon_a January 17, 2012 04:19

Why not create a movie from the jpg files (=frames)?
I used the command:

mencoder -ovc copy -mf w=1164:h=752:fps=20:type=jpg 'mf://*.jpg' -o output.avi

and then you can convert it to anything you want.

tunkers January 17, 2012 19:07

Your suggestion works well! Thanks anon_a

deepsterblue January 18, 2012 09:50

Or, if you want to take the long way out and actually compile ParaView with ffmpeg support, toggle advanced options during ccmake (if you have CMake installed with libcurses support, or use the -D[option-name] at the command line), and search/specify the FFMPEG-related entries, where you have to specify the location of your ffmpeg headers and libraries.

After cycling through configuration in cmake, generate the Makefile and compile ParaView as usual. You should then see avi output support for animations.

tunkers January 19, 2012 21:49

Hi Sandeep, Thanks for the tip, I installed ccmake and now the cmake gui works. If I run ccmake in the main folder /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0 and toggle advanced options, I get a list of the following configuration flags, but none of them seem related to ffmeg. Maybe the paraview that comes with the openfoam thirdparty tools is somehow packaged differently? Any ideas?


CMAKE_AR                        /usr/bin/ar                                                                                                             
 CMAKE_COLOR_MAKEFILE            ON                                                                                                                       
 CMAKE_CXX_COMPILER              /usr/bin/c++                                                                                                             
 CMAKE_CXX_FLAGS_DEBUG            -g                                                                                                                       
 CMAKE_CXX_FLAGS_MINSIZEREL      -Os -DNDEBUG                                                                                                             
 CMAKE_CXX_FLAGS_RELEASE          -O3 -DNDEBUG                                                                                                             
 CMAKE_CXX_FLAGS_RELWITHDEBINFO  -O2 -g                                                                                                                   
 CMAKE_C_COMPILER                /usr/bin/gcc                                                                                                             
 CMAKE_C_FLAGS_DEBUG              -g                                                                                                                       
 CMAKE_C_FLAGS_MINSIZEREL        -Os -DNDEBUG                                                                                                             
 CMAKE_C_FLAGS_RELEASE            -O3 -DNDEBUG                                                                                                             
 CMAKE_C_FLAGS_RELWITHDEBINFO    -O2 -g                                                                                                                   
 CMAKE_INSTALL_PREFIX            /usr/local                                                                                                               
 CMAKE_LINKER                    /usr/bin/ld                                                                                                             
 CMAKE_MAKE_PROGRAM              /usr/bin/make                                                                                                           
 CMAKE_NM                        /usr/bin/nm                                                                                                             
 CMAKE_OBJCOPY                    /usr/bin/objcopy                                                                                                         
 CMAKE_OBJDUMP                    /usr/bin/objdump                                                                                                         
 CMAKE_RANLIB                    /usr/bin/ranlib                                                                                                         
 CMAKE_SKIP_RPATH                OFF                                                                                                                     
 CMAKE_STRIP                      /usr/bin/strip                                                                                                           
 CMAKE_USE_RELATIVE_PATHS        OFF                                                                                                                     
 CMAKE_VERBOSE_MAKEFILE          OFF                                                                                                                     
 GIT_EXECUTABLE                  GIT_EXECUTABLE-NOTFOUND                                                                                                 

deepsterblue January 20, 2012 09:45

Not sure if you're doing the build process correctly. Follow the instructions at:

Hope this helps.

wyldckat January 21, 2012 22:08

Greetings to all!

Here's a few more solutions:
  • It shouldn't be necessary to edit the file directly, because you can send those values via makeParaView:

    Nonetheless, you'll need a compatible version of FFMPEG for this to work. ParaView 3.12.0 seems to have been tested well with FFMPEG 0.6.1:
    It fails with me on Ubuntu 11.10 x86_64 and the system default FFMPEG 0.7.3.
  • You can also try the "SuperBuild" folder, which takes care of building everything that ParaView needs. I've finished writing the instructions: ParaView 3.12.0 SuperBuild on OpenFOAM
The list of variables that might come in handy if you need to manually set them all via command line (these were adapted from the "SuperBuild"):


Best regards,

All times are GMT -4. The time now is 00:59.