CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Paraview 3.12 - How to compile with ffmpeg for animation (https://www.cfd-online.com/Forums/openfoam-installation/96232-paraview-3-12-how-compile-ffmpeg-animation.html)

tunkers January 16, 2012 23: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

/mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/CMakeLists.txt,

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

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:
/mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/FFMPEG_INCLUDE_DIR
  used as include directory in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
FFMPEG_avcodec_LIBRARY
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
FFMPEG_avformat_LIBRARY
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
FFMPEG_avutil_LIBRARY
    linked by target "vtkIO" in directory /mnt/data3/OpenFOAM/ThirdParty-2.1.0/ParaView-3.12.0/VTK/IO
FFMPEG_swscale_LIBRARY (ADVANCED)
    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?

Thanks,

Eric

anon_a January 17, 2012 03: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 18:07

Your suggestion works well! Thanks anon_a

deepsterblue January 18, 2012 08: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 20: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?


Code:

CMAKE_AR                        /usr/bin/ar                                                                                                             
 CMAKE_BUILD_TYPE                                                                                                                                         
 CMAKE_COLOR_MAKEFILE            ON                                                                                                                       
 CMAKE_CXX_COMPILER              /usr/bin/c++                                                                                                             
 CMAKE_CXX_FLAGS                                                                                                                                           
 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                                                                                                                                             
 CMAKE_C_FLAGS_DEBUG              -g                                                                                                                       
 CMAKE_C_FLAGS_MINSIZEREL        -Os -DNDEBUG                                                                                                             
 CMAKE_C_FLAGS_RELEASE            -O3 -DNDEBUG                                                                                                             
 CMAKE_C_FLAGS_RELWITHDEBINFO    -O2 -g                                                                                                                   
 CMAKE_EXE_LINKER_FLAGS                                                                                                                                   
 CMAKE_EXE_LINKER_FLAGS_DEBUG                                                                                                                             
 CMAKE_EXE_LINKER_FLAGS_MINSIZE                                                                                                                           
 CMAKE_EXE_LINKER_FLAGS_RELEASE                                                                                                                           
 CMAKE_EXE_LINKER_FLAGS_RELWITH                                                                                                                           
 CMAKE_INSTALL_PREFIX            /usr/local                                                                                                               
 CMAKE_LINKER                    /usr/bin/ld                                                                                                             
 CMAKE_MAKE_PROGRAM              /usr/bin/make                                                                                                           
 CMAKE_MODULE_LINKER_FLAGS                                                                                                                                 
 CMAKE_MODULE_LINKER_FLAGS_DEBU                                                                                                                           
 CMAKE_MODULE_LINKER_FLAGS_MINS                                                                                                                           
 CMAKE_MODULE_LINKER_FLAGS_RELE                                                                                                                           
 CMAKE_MODULE_LINKER_FLAGS_RELW                                                                                                                           
 CMAKE_NM                        /usr/bin/nm                                                                                                             
 CMAKE_OBJCOPY                    /usr/bin/objcopy                                                                                                         
 CMAKE_OBJDUMP                    /usr/bin/objdump                                                                                                         
 CMAKE_RANLIB                    /usr/bin/ranlib                                                                                                         
 CMAKE_SHARED_LINKER_FLAGS                                                                                                                                 
 CMAKE_SHARED_LINKER_FLAGS_DEBU                                                                                                                           
 CMAKE_SHARED_LINKER_FLAGS_MINS                                                                                                                           
 CMAKE_SHARED_LINKER_FLAGS_RELE                                                                                                                           
 CMAKE_SHARED_LINKER_FLAGS_RELW                                                                                                                           
 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 08:45

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

http://www.paraview.org/Wiki/ParaView:Build_And_Install

Hope this helps.

wyldckat January 21, 2012 21: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:
    Code:

    ./makeParaView VTK_USE_FFMPEG_ENCODER=TRUE
    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: http://www.paraview.org/Wiki/ParaVie...12.0_and_above
    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"):
Code:

FFMPEG_INCLUDE_DIR:PATH=$WM_THIRD_PARTY_DIR/build/linux64Gcc/SuperBuild/include
FFMPEG_avcodec_LIBRARY:FILEPATH=$WM_THIRD_PARTY_DIR/build/linux64Gcc/SuperBuild/lib/libavcodec.so
FFMPEG_avformat_LIBRARY:FILEPATH=$WM_THIRD_PARTY_DIR/build/linux64Gcc/SuperBuild/lib/libavformat.so
FFMPEG_avutil_LIBRARY:FILEPATH=$WM_THIRD_PARTY_DIR/build/linux64Gcc/SuperBuild/lib/libavutil.so
FFMPEG_dc1394_LIBRARY:FILEPATH=FFMPEG_dc1394_LIBRARY-NOTFOUND
FFMPEG_dts_LIBRARY:FILEPATH=FFMPEG_dts_LIBRARY-NOTFOUND
FFMPEG_gsm_LIBRARY:FILEPATH=FFMPEG_gsm_LIBRARY-NOTFOUND
FFMPEG_swscale_LIBRARY:FILEPATH=$WM_THIRD_PARTY_DIR/build/linux64Gcc/SuperBuild/lib/libswscale.so
FFMPEG_theora_LIBRARY:FILEPATH=FFMPEG_theora_LIBRARY-NOTFOUND
FFMPEG_vorbis_LIBRARY:FILEPATH=FFMPEG_vorbis_LIBRARY-NOTFOUND
FFMPEG_vorbisenc_LIBRARY:FILEPATH=FFMPEG_vorbisenc_LIBRARY-NOTFOUND
FFMPEG_z_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libz.so

Best regards,
Bruno


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