|
|
There are two ways to generate videos from simulation output:
|
|
|
|
|
|
1. Manual recording using Vadere's `PostVisualization`
|
|
|
2. Automatic recording
|
|
|
|
|
|
## Manual recording
|
|
|
|
|
|
Start Vadere's `PostVisualization` ![vadere_post_vis_ide](uploads/9931aa3bce2982383257e3283d860775/vadere_post_vis_ide.png)
|
|
|
|
|
|
Go to `File` and `Open File...` and choose the simulation output by picking the `postvis.traj` file in the corresponding folder.
|
|
|
|
|
|
![vadere_post_vis](uploads/ba2f8663cb696bdb5c9068b3cdfc1655/vadere_post_vis.png)
|
|
|
|
|
|
Push the `Record button` and follow the instructions. Do not forget to terminate the recording by pushing the `Record button` again.
|
|
|
|
|
|
![vadere_post_vis_record](uploads/86a0394749cd47b45f342492e85d6155/vadere_post_vis_record.png)
|
|
|
|
|
|
## Automatic recording
|
|
|
|
|
|
### Single scenario
|
|
|
|
|
|
Automatic recording of videos is possible using the `VideoRecorder`. The simulation output directory must be specified over the CLI arguments.
|
|
|
|
|
|
#### In the terminal
|
|
|
|
|
|
Firstly, generate the `vadere-video.jar` that starts the `VideoRecorder` application. In the terminal, run:
|
|
|
|
|
|
```
|
|
|
mvn clean
|
|
|
mvn -Dmaven.test.skip=true package
|
|
|
```
|
|
|
|
|
|
After the packaging process has finshed, you can find the `vadere-video.jar` in `VadereGui/target`.
|
|
|
|
|
|
Secondly, run `vadere-video.jar` e.g. from Vadere `root`:
|
|
|
|
|
|
```
|
|
|
java -jar VadereGui/target/vadere-video.jar -i path/to/sim/outputdir
|
|
|
```
|
|
|
|
|
|
Do not forget to specify the simulation output directory where the `\*scenario` and the `\*postvis.traj` is stored using `-i`. (Note that `-i` expects a directory; do not provide the `postvis.traj` here.)
|
|
|
|
|
|
The generated video is stored as `movie.mov` in the simulation output directory if the path is not specified manually (`-o`).
|
|
|
|
|
|
See the help menu `-h` to see how video name and path and additional settings can be passed over the command line:
|
|
|
|
|
|
```
|
|
|
java -jar VadereGui/target/vadere-video.jar -h
|
|
|
```
|
|
|
|
|
|
#### In an IDE (IntelliJ)
|
|
|
|
|
|
For debugging the `VideoRecorder` can be started also in an IDE. CLI arguements must be specified in the configuration:
|
|
|
|
|
|
![configuration](uploads/de1231c31b92cf2680e1b1e972ef5cd1/configuration.png)
|
|
|
|
|
|
As in the terminal, the help menu `-h` can be displayed:
|
|
|
|
|
|
![configurationHelp](uploads/6980603079f8cf2a4743a5eb1721013d/configurationHelp.png)
|
|
|
|
|
|
Running the `VideoRecorder` with this configuration displays the CLI arguments:
|
|
|
|
|
|
![HelpMenu](uploads/8964d018abeedaf79415964703da2f99/HelpMenu.png)
|
|
|
|
|
|
### Multiple scenarios
|
|
|
|
|
|
We use the python script `Tools/ContinuousIntegration/run_vadere_video.py` to generate multiple videos from multiple videos. To generate videos from any simulation output that can be found in the directory `Scenarios` run from Vadere `root`:
|
|
|
|
|
|
```
|
|
|
python3 Tools/ContinuousIntegration/run_vadere_video.py -i Scenarios -o VideoOutputDir
|
|
|
```
|
|
|
|
|
|
The videos are stored in the folder `VideoOutputDir` in the `root` directory.
|
|
|
|
|
|
It is also possible to run scenarios first and then generate videos from the resulting simulation output with the configuration
|
|
|
|
|
|
```
|
|
|
python3 Tools/ContinuousIntegration/run_vadere_video.py -d Scenarios --scenarios-specified-in-config-only -o VideoOutputDir
|
|
|
```
|
|
|
|
|
|
`-d` specifies the directory which \*.scenario files should be run. `--scenarios-specified-in-config-only` limites the list of scenarios to scenarios that are specified in the `VIDEO.config` (see next section for more details). Note that we use this configuration in the CI pipeline. |
|
|
\ No newline at end of file |