vision.DeployableVideoPlayer - Display video - MATLAB (original) (raw)
Description
The DeployableVideoPlayer
object displays video frames. This player is capable of displaying high definition video at high frame rates. This video player object supports C code generation.
Note
Starting in R2016b, instead of using the step
method to perform the operation defined by the System objectâ„¢, you can call the object with arguments, as if it were a function. For example, y = step(obj,x)
and y = obj(x)
perform equivalent operations.
Creation
Syntax
Description
depVideoPlayer = vision.DeployableVideoPlayer
returns a video player depVideoPlayer
, for displaying video frames. This object, unlike the vision.VideoPlayer object, can generate C code.
`depVideoPlayer` = vision.DeployableVideoPlayer(`Name,Value`)
sets properties using one or more name-value pairs. Enclose each property name in quotes. For example, depVideoPlayer = vision.DeployableVideoPlayer('Name','Caption title')
Properties
Location of bottom left corner of video frame, specified as a two-element vector. The first and second elements are specified in pixels and represent the horizontal and vertical coordinates respectively. The coordinates [0 0]
represent the bottom left corner of the screen. The default location depends on the screen resolution, and will result in a window positioned in the center of the screen.
Video window title bar caption, specified as the comma-separated pair consisting of 'Name
' and a character vector.
Size of video display window, specified as the comma-separated pair consisting of 'Size
' and Full-screen
, True size (1:1)
or Custom
. When this property is set toFull-screen
, use the Esc
key to exit out of full-screen mode.
Custom size for video player window, specified as the comma-separated pair consisting of 'CustomSize
' and a two-element vector. The first and second elements are specified in pixels and represent the horizontal and vertical components respectively. The video data will be resized to fit the window. This property applies when you set the Size
property toCustom
.
Color format of input signal, specified as the comma-separated pair consisting of 'InputColorFormat
' and 'RGB'
or 'YCbCr 4:2:2'
. The number of columns in the Cb and Cr components must be half the number of columns in Y.
Usage
Syntax
Description
depVideoPlayer([videoFrame](#bse%5Frxz%5Fsep%5Fmw%5Fa25bd927-621b-4b2d-9f1e-dba14d8c66cf))
displays one grayscale or truecolor RGB video frame in the video player.
depVideoPlayer([videoFrame](#bse%5Frxz%5Fsep%5Fmw%5Fa25bd927-621b-4b2d-9f1e-dba14d8c66cf),[Y,Cb,Cr](#bse%5Frxz%5Fsep%5Fmw%5F476f57cc-3284-42cc-bc78-0d3be1e89ac2))
displays one frame of YCbCr 4:2:2 video in the color components Y, Cb, and Cr when you set the InputColorFormat
property to YCbCr 4:2:2
. The number of columns in the Cb and Cr components must be half the number of columns in the Y component.
Input Arguments
Video frame, specified as a truecolor or 2-D grayscale image.
YCbCr color format, returned in the YCbCr 4:2:2
format.
Object Functions
To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj
, use this syntax:
isOpen | Visible or hidden status for player |
---|
step | Run System object algorithm |
---|---|
release | Release resources and allow changes to System object property values and input characteristics |
reset | Reset internal states of System object |
Examples
Create a video reader and a video player object to read and view a video file.
vidReader = VideoReader('atrium.mp4'); depVideoPlayer = vision.DeployableVideoPlayer;
Continue to read frames of video until the last frame is read. Exit the loop if the user closes the video player window.
while hasFrame(vidReader) videoFrame = readFrame(vidReader); depVideoPlayer(videoFrame); end
Release the video player object.
Extended Capabilities
Version History
Introduced in R2012a