Skip to content

SteerSuiteSimulationVideo

Neo-X edited this page Sep 18, 2015 · 1 revision

Note: it is best to look over SteerSim first to understand the command format.

SteerSim has the ability to dump ppm files for each of the frames renderd from the simulation. This can be done with the following command.

../build/bin/steersim -ai hybridAI -config configs/pprAI-config.xml -testcase ../testcases/4-way-oncomming.xml -saveFramesTo ./frames/

the config option is optional but highly recomended. Especially because one of the options in the config file controls the size of the images taken of the simulation.

<!-- Width of the openGL window in pixels -->
<windowSizeX>1200</windowSizeX>

<!-- Height of the openGL window in pixels -->
<windowSizeY>800</windowSizeY>

Which means changing the size of the window after the simulation has started could have undesired affects.

Then during the simulation to start dumping frame press the "home" key on your computer and to stop either the simulation could be ended or the "end" key could be pressed.

TO convert the files to a movie it is recommended to use ffmpeg/avconv like so

#!/bin/bash

baseDirectory=$1
fileBasename="frame"
frameSize=$2

#example Usage
# ./encodeVideo <dir> <width_x_height>
# ./encodeVideo ./frames/ 1200x800

path=$baseDirectory$fileBasename

echo $dir

ffmpeg -y -i $path%d.ppm -acodec libfaac -ar 44100 -ab 96k -coder ac -me_range 16 -subq 5 -sc_threshold 40 -vcodec libx264 -s $frameSize -b 1600k -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 "scenario_".mp4

This will save the video as "scenario_.mp4"

-- Main.GlenBerseth - 2013-12-20