exportVideo
Export RoadRunner scenario simulation data to video file using MATLAB
Since R2026a
Description
exportVideo( exports the scenario
simulation data of the specified RoadRunner Scenario application rrApp)rrApp to
a video file.
exportVideo(
sets options using one or more name-value arguments. For example,
rrApp,Name=Value)VideoResolution="SD" exports the scenario simulation data to a video
file with a resolution of 640x480.
Examples
Export scenario simulation data to a video file using MATLAB®.
Create a roadrunner object, specifying the path to an existing project. For example, this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject". This code assumes that RoadRunner is installed in the default location, and returns an object, rrApp, that provides functions for performing basic tasks such as opening, closing, and saving scenes and projects.
rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");Note: If you are opening RoadRunner from MATLAB® for the first time, or if you have changed the RoadRunner installation location since you last opened it from MATLAB, you can use the roadrunnerSetup (RoadRunner) function to specify new default project and installation folders to use when opening RoadRunner. You can save these folders between MATLAB sessions by selecting the Across MATLAB sessions option from the corresponding drop down.
Open the TrajectoryCutIn.rrscenario scenario in RoadRunner Scenario by using the openScenario function. This scenario is included by default in RoadRunner projects, and is located in the Scenarios folder of the project.
filename = "TrajectoryCutIn.rrscenario";
openScenario(rrApp,filename);Run the simulation by using the simulateScenario function, and set EnableLogging to true to enable RoadRunner Scenario to log the simulation data.
simulateScenario(rrApp,EnableLogging=true);
Export the simulation data by using the exportVideo function, specifying the rrApp object. Specify the folder path and the filename to which you want to export the video file using the VideoFolder and FileName name-value arguments, respectively. Once the simulation is complete, RoadRunner exports the video file to the specified export folder. You can now navigate to the export folder and locate the video file.
exportVideo(rrApp,VideoFolder="C:\RR\MyProject\Exports",FileName="TrajectoryCutIn");
Input Arguments
RoadRunner application associated with a project, specified as a
roadrunner object. This object provides functions
for performing common workflow tasks such as opening, closing, and saving scenes and
projects. rrApp provides functions that support importing data from
files and exporting scenes to other formats from RoadRunner.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: exportVideo(rrApp,VideoResolution="SD") exports the scenario
simulation data to a video file with a resolution of 640x480.
Export folder path, specified as a character vector or string scalar. Use this
argument to specify an absolute path to the folder in which to export the video file.
If the specified folder path does not exist, then RoadRunner returns an error. If you do not specify a value for the
VideoFolder argument, then RoadRunner exports the video to the Exports folder of the
current project folder.
Data Types: char | string
Name of the exported video file, specified as a character vector or string scalar.
RoadRunner exports the video file with the name
FileName., where
extext is the extension corresponding to the format of the
video file. RoadRunner supports only .mp4 and
.avi video formats. The file format of the exported video depends
on the video codec available on your system.
If you do not specify a value for the FileName argument, the
default behavior of RoadRunner depends on whether you have saved the current scenario.
If you have saved the current scenario, RoadRunner creates a file with the same name as the saved scenario. For example,
.MyScenario.extIf you have not saved the current scenario, RoadRunner creates a file with the name
New Scenario. For example,New Scenario..ext
Data Types: char | string
Resolution of the exported video file, specified as one of the values in this table:
| Value | Resolution |
|---|---|
"SD" | 640x480 |
"HD" | 1280x720 |
"FullHD" | 1920x1080 |
"QuadHD" | 2560x1440 |
Data Types: char | string
Version History
Introduced in R2026a
See Also
roadrunner | openScenario | simulateScenario | setCameraMode
Topics
- RoadRunner Scenario Fundamentals (RoadRunner Scenario)
- Simulate a RoadRunner Scenario Using MATLAB Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)