Video Read
Add-On Required: This feature requires the MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms add-on.
Libraries:
NVIDIA Jetson and NVIDIA DRIVE /
Audio and Video
Description
The Video Read block reads video frames from a multimedia file on the NVIDIA® target platform.
This block uses the Gstreamer framework to handle data streaming. You can use the video formats supported by your installed plug-ins for GStreamer 1.0 or higher, as listed on Plugins.
Ports
Output
Image — Color image or video frame
array
Color image or video frame, returned as an M-by-N-by-P array. M and N are the number of rows and columns in each image. P is the number of color channels in each image.
Dependencies
To enable this port, set the Image signal parameter to
One multidimensional signal
.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| Simulink.ImageType
R — Red color component of image or video frame
matrix
Red color component of the image or video frame, returned as an M-by-N matrix. M and N are the number of rows and columns in the image.
Dependencies
To enable this port, set the Image signal parameter to
Separate color signal
.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
G — Green color component of image or video frame
matrix
Green color component of the image or video frame, returned as an M-by-N matrix. M and N are the number of rows and columns in the image.
Dependencies
To enable this port, set the Image signal parameter to
Separate color signal
.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
B — Blue color component of image or video frame
matrix
Blue color component of the image or video frame, returned as an M-by-N matrix. M and N are the number of rows and columns in the image.
Dependencies
To enable this port, set the Image signal parameter to
Separate color signal
.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
EOF — End-of-file indicator
scalar
End-of-file indicator, returned as a logical scalar for each video frame. The
end-of-file indicator is 1
when the block outputs the final video
frame from the file, and is 0
otherwise.
Dependencies
To enable this port, select the Output end-of-file indicator parameter.
Data Types: Boolean
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
General ParametersFile name — Name of multimedia file
no default
Name of the multimedia file on the target for the block to read.
Programmatic Use
To set the block parameter value programmatically, use
the set_param
(Simulink) function.
To get the block parameter value
programmatically, use the get_param
(Simulink) function.
Parameter: | FileName |
Values: | ' ' (default) | character vector |
Sample time — Block sample time
0.033333333333333333
(default) | real positive scalar
Image size — Resolution of the image or video frame
[640, 480]
(default) | [width, height]
Resolution of the image or video frame, in pixels.
Programmatic Use
To set the block parameter value programmatically, use
the set_param
(Simulink) function.
To get the block parameter value
programmatically, use the get_param
(Simulink) function.
Parameter: | ImageSize |
Values: | '[640, 480]' (default) | [width, height] |
Image signal — Output port configuration
One multidimensional signal
(default) | Separate color signal
How the block outputs the RGB color video. If you select One
multidimensional signal
, the block outputs the video data using only the
Image port. If you select Separate color
signal
, the block outputs the video data using three separate color
channels, divided across the R, G, and
B ports.
Programmatic Use
To set the block parameter value programmatically, use
the set_param
(Simulink) function.
To get the block parameter value
programmatically, use the get_param
(Simulink) function.
Parameter: | ImageSignal |
Values: | 'One multidimensional signal' (default) | 'Separate color signal' |
Output end-of-file indicator — End-of-file indicator
off
(default) | on
Select this parameter to enable the EOF port, which indicates whether the output frame or sample is the final video frame in the multimedia file.
Programmatic Use
To set the block parameter value programmatically, use
the set_param
(Simulink) function.
To get the block parameter value
programmatically, use the get_param
(Simulink) function.
Parameter: | OutputEOFIndicator |
Values: | 'off' (default) | 'on' |
Version History
Introduced in R2024a
See Also
Blocks
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)