|
|
There are two ways to generate videos from simulation output:
|
|
|
1. Manual recording using Vadere's `PostVisualization`
|
|
|
|
|
|
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)
|
|
|
|
|
|
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.
|
|
|
|
... | ... | @@ -20,36 +21,40 @@ Push the `Record button` and follow the instructions. Do not forget to terminate |
|
|
|
|
|
Automatic recording of videos is possible using the `VideoRecorder`. The simulation output directory must be specified over the CLI arguments.
|
|
|
|
|
|
|
|
|
|
|
|
#### In the terminal
|
|
|
#### 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`.
|
|
|
|
|
|
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`).
|
|
|
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:
|
|
|
|
|
|
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:
|
|
|
As in the terminal, the help menu `-h` can be displayed:
|
|
|
|
|
|
![configurationHelp](uploads/6980603079f8cf2a4743a5eb1721013d/configurationHelp.png)
|
|
|
|
... | ... | @@ -57,57 +62,57 @@ 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`:
|
|
|
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. We use this configuration to produce videos in the CI pipeline. See the next section for details.
|
|
|
|
|
|
#### CI Videos generation: Adding/removing scenarios
|
|
|
|
|
|
The CI generated videos for scenarios that are specified in `VIDEO.config` files. To add all scenario files of a vadere project, create an empty `VIDEO.config` file in the corresponding scenario folder with the following content
|
|
|
|
|
|
```
|
|
|
# This VIDEO.config adds scenarios of this vadere project to the list of scenarios for which the CI generate videos.
|
|
|
|
|
|
# The following line adds all scenario files of this vadere project:
|
|
|
*.scenario
|
|
|
|
|
|
# Place the VIDEO.config in the scenarios folder of the vadere project (the usage of relative paths has not been tested so far).
|
|
|
```
|
|
|
Vadere projects that do not contain `VIDEO.config` files in their `scenarios` folder will be fully ignored. `*.scenario` in a `VIDEO.config` adds all scenario files of a Vadere project at once. It is also possible to specify the scearios.
|
|
|
The videos are stored in the folder `VideoOutputDir` in the `root` directory.
|
|
|
|
|
|
To test the CI, run the script with the following configuration:
|
|
|
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.
|
|
|
|
|
|
## Generate and download videos from the server (using the CI)
|
|
|
|
|
|
|
|
|
You can generate and download videos for specified scenarios from our server using Vadere's Continuous Integration pipeline.
|
|
|
|
|
|
Please follow the steps:
|
|
|
|
|
|
1. On gitlab LRZ navigate to the [Vadere CI](https://gitlab.lrz.de/vadere/vadere/-/pipelines). You should see the list of pipelines:
|
|
|
|
|
|
![pipeline_overview](uploads/aa1c433e23f847ce0fa5cfeed3fa8156/pipeline_overview.png)
|
|
|
|
|
|
2. Each pipeline corresponds to a different commit. If you want to generate videos for the most recent `master` branch use a filter (see below) and click on the corresponding pipeline:
|
|
|
|
|
|
![master_pipeline_filter_2](uploads/6b585914d3bf91515ef0d1a68ad8c8c1/master_pipeline_filter_2.png)
|
|
|
|
|
|
3. To trigger the video generation, you have to wait until the CI has the status "Passed" (in the example below the CI is still "Running"). As soon as it has the status "Passed", you can trigger the video generation by clicking on the video generation job:
|
|
|
|
|
|
![trigger_video_gen](uploads/93fb544c4f68d352d071d4733117e5f9/trigger_video_gen.png)
|
|
|
|
|
|
4. Open the job. You should see the loggings of the server. As soon as the video generation job is finished, you can download the videos by clicking on downloads:
|
|
|
|
|
|
![download_artifacts](uploads/d2739b1e216fbc7c35ca8e4083e7d0ed/download_artifacts.png)
|
|
|
|
|
|
### Your video is missing?
|
|
|
|
|
|
The CI generates videos for scenarios only that are specified in so-called `VIDEO.config` files. Make sure that your scenario file is listed in the `VIDEO.config`file of the corresponding Vadere project in `Scenarios/`. If the Vadere Project does not contain a `VIDEO.config`, create an empty text file called `VIDEO.config` in the `scenarios` folder. Add all scenario files (`\*.scenario`) of a vadere project at once by copying and pasting the following content into `VIDEO.config`
|
|
|
|
|
|
```
|
|
|
# This VIDEO.config adds scenarios of this vadere project to the list of scenarios for which the CI generate videos.
|
|
|
|
|
|
# The following line adds all scenario files of this vadere project:
|
|
|
*.scenario
|
|
|
|
|
|
# Place the VIDEO.config in the scenarios folder of the vadere project (the usage of relative paths has not been tested so far).
|
|
|
```
|
|
|
|
|
|
|
|
|
\ No newline at end of file |
|
|
Vadere projects that do not contain `VIDEO.config` files in their `scenarios` folder will be fully ignored. `\*.scenario` in a `VIDEO.config` adds all scenario files of a Vadere project at once. It is also possible to specify the scenarios. |
|
|
\ No newline at end of file |