Views

HowToMakeAVideo

!! The C++ code and this HowTo will be enhanced in the upcoming weeks !!

Contents

Capture all the frames

  • Launch your :: SOFA :: project
  • With the mouse, undock the viewer of the main window : drag and drop it outside of the main window
  • With the mouse, resize the viewer the smallest you can : the minimun resolution is set to 640x480 (you can check this size in the command line shell).
  • Click the left-button mouse into the viewer (to make it active) and press the key "v" to start the capture of the updaded frames.
  • Then start the animation (click the ANIM button)
  • Wait...
  • Stop the animation, click onto the viewer and press "v".

All the captured frames are named capture####.bmp and are saved in the current project directory.

Encode the video

To encode the video from the capture frames

Linux

  • Convert the .bmp files to .ppm : use convert. You can use this script:
#!/bin/sh
for i in $(ls *.$1)
do
j=${i/$1/$2}
echo 'Convert '$i' to '$j
`convert $i $j`
done

Name this file convert.sh and make it executable : chmod +x convert.sh

and launch it : ./convert.sh bmp ppm

  • Use ffmpeg [1]: ffmpeg -b 10000 -r 30 -i capture%4d.ppm video.mp4 (janvier 2007)

Windows

  •  ???