CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

Paraview 3.12 - How to compile with ffmpeg for animation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2012, 00:08
Default Paraview 3.12 - How to compile with ffmpeg for animation
  #1
New Member
 
Eric
Join Date: Aug 2010
Posts: 14
Rep Power: 15
tunkers is on a distinguished road
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
tunkers is offline   Reply With Quote

Old   January 17, 2012, 04:19
Default
  #2
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
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.
anon_a is offline   Reply With Quote

Old   January 17, 2012, 19:07
Default
  #3
New Member
 
Eric
Join Date: Aug 2010
Posts: 14
Rep Power: 15
tunkers is on a distinguished road
Your suggestion works well! Thanks anon_a
tunkers is offline   Reply With Quote

Old   January 18, 2012, 09:50
Default
  #4
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
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.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   January 19, 2012, 21:49
Default
  #5
New Member
 
Eric
Join Date: Aug 2010
Posts: 14
Rep Power: 15
tunkers is on a distinguished road
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                                                                                                   
tunkers is offline   Reply With Quote

Old   January 20, 2012, 09:45
Default
  #6
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
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.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   January 21, 2012, 22:08
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________

Last edited by wyldckat; January 23, 2012 at 16:26. Reason: blog post has been approved.
wyldckat is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
paraview installation woes vex OpenFOAM Installation 15 January 30, 2011 08:11
Cmake cannot recognize gcc to compile ParaView CAVT OpenFOAM 3 July 27, 2010 21:38
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51
[OpenFOAM] Steps to compile paraview from source hsieh ParaView 12 March 21, 2008 20:45


All times are GMT -4. The time now is 09:35.