Write binary video data to file
Computer Vision Toolbox / Sinks
The Write Binary File block takes the video data from a Simulink® model and exports it to a binary file.
This block produces a raw binary file with no header information. It has no encoded information providing the data type, frame rate, or dimensionality. The video data for this block appears in row-major format.
Note
This block supports code generation only for platforms that have file I/O available. The block does not support code generation using Simulink Desktop Real-Time™ or Simulink Real-Time™.
Y'
— Luminance component of input video streamLuminance component of the input video stream, specified as a scalar, vector, or
matrix. The label of this port can be changed using the
Component1 parameter when the Video format
parameter is set to Custom
.
Data Types: int8
| int16
| int32
| uint8
| uint16
| uint32
Cb
— Blue difference component of the input video streamBlue difference component of the input video stream, specified as a scalar,
vector, or matrix. The label of this port can be changed using the
Component2 parameter when the Video format
parameter is set to Custom
.
Data Types: int8
| int16
| int32
| uint8
| uint16
| uint32
Cr
— Red difference component of input video streamRed difference component of the input video stream, specified as a scalar, vector,
or matrix. The label of this port can be changed using the
Component3 parameter when the Video format
parameter is set to Custom
.
Data Types: int8
| int16
| int32
| uint8
| uint16
| uint32
A
— Alpha component of input video streamAlpha component of the input video stream, specified as a scalar, vector, or
matrix. The label of this port can be changed using the
Component4 parameter when the Video format
parameter is set to Custom
.
To enable this port, use one of these options.
Set the Video format parameter to Four
character codes
, and set the Four character
code parameter to AYUV
or
IF09
.
Set the Video format parameter to
Custom
, and the Number of
inputs parameter to 4
. In this case,
the name of this port is Alpha.
Data Types: int8
| int16
| int32
| uint8
| uint16
| uint32
T
— Transparency component of input video streamTransparency component of the input video stream, specified as a scalar, vector, or matrix.
To enable this port, set the Video format parameter to
Four character codes
, and set the Four
character code parameter to Y41T
or
Y42T
.
Data Types: int8
| int16
| int32
| uint8
| uint16
| uint32
File name
— Name of the binary fileoutput.bin
(default) | file name Specify the name of the output binary file, with a .bin
extension, for the video data. Click Save As to specify the
location for the file.
Video format
— Format of the video data Four character codes
(default) | Custom
Specify the format of the video data as one of these options.
Four character codes (FOURCC) — For more information about these codes, see
https://www.fourcc.org
.
Custom — Read the video data from a binary file of a custom format.
Four character code
— Format of binary fileI420
(default) | AYUV
| CLJR
| cyuv
| GREY
| IF09
| IMC1
| IMC2
| IMC3
| IMC4
| IUYV
| IY41
| IYU1
| IYU2
| IYUV
| NV12
| NV21
| UYNV
| UYNY
| V210
| Y411
| Y41P
| Y41T
| Y422
| Y42T
| Y8
| Y800
| YUNV
| YUY2
| YUYV
| YV12
| YV16
| YVU9
| YVYU
| ...Select the four character code of the desired codec for the binary file. The value of this parameter also determines the number of input ports on the block. For information on which four character codes enable which input ports, see Input Ports for Four Character Codes.
To enable this parameter, set the Video Format parameter to
Four character codes
.
Line ordering
— Binary file fill directionTop line first
(default) | Bottom line first
If you select Top line first
, the block begins filling the
binary file with the first row of the video frame. It then fills the file with the other
rows in increasing order. If you select Bottom line first
, the block
begins filling the binary file with the last row of the video frame. It then fills the
file with the other rows in decreasing order.
Bit stream format
— Data format of binary filePlanar
(default) | Packed
Specify the data format of the binary file as Planar
or
Packed
.
To enable this parameter, set the Video Format parameter to Custom.
Number of inputs
— Number of components in input video stream3
(default) | 1
| 2
| 4
Specify the number of components in the input video stream. This parameter sets the number of input ports.
To enable this parameter, set the Video Format parameter to
Custom
.
Inherit size of components from input data type
— All components have same number of bitson
(default) | off
Select the Inherit size of components from input data type parameter to indicate that all of the components have the same number of bits as the input data type. If you clear this parameter, you can specify the number of bits for each enabled component using the associated Bits parameter.
To enable this parameter, set the Video Format parameter to
Custom
.
Component1
— Name of luminance component input portY'
(default) | component nameSpecify the name of the input port for the luminance component of the input video stream.
To enable this parameter, set the Video format parameter to
Custom
, set the Number of inputs
parameter to 1
or greater .
Component2
— Name of blue difference componentCb
(default) | component nameSpecify the name of the input port for the blue difference component of the input video stream.
To enable this parameter, set the Video format parameter to
Custom
, set the Number of inputs
parameter to 2
or greater .
Component3
— Name of red difference componentCr
(default) | component nameSpecify the name of the input port for the red difference component of the input video stream.
To enable this parameter, set the Video format parameter to
Custom
, set the Number of inputs
parameter to 3
or greater .
Component4
— Name of alpha componentSpecify the name of the input port for the alpha component of the input video stream.
To enable this parameter, set the Video format parameter to
Custom
, set the Number of inputs
parameter to 4
.
Bits1
— Size of luminance component8
(default) | 0
| 16
| 24
| 32
Specify the size of the luminance component in the input video stream. The value of
this parameter determines the interpretation of the video stream data as
8
-bit, 16
-bit, 24
-bit, or
32
-bit.
To enable this parameter, set the Video format parameter to
Custom
, and set the Number of inputs
parameter to 1
or greater, and select the Inherit
size of components from input data type parameter.
Bits2
— Size of blue difference component8
(default) | 0
| 16
| 24
| 32
Specify the size of the blue difference component in the input video stream. The
value of this parameter determines the interpretation of the video stream data as
8
-bit, 16
-bit, 24
-bit, or
32
-bit.
To enable this parameter, set the Video format parameter to
Custom
, and set the Number of inputs
parameter to 2
or greater, and select the Inherit
size of components from input data type parameter.
Bits3
— Size of red difference component8
(default) | 0
| 16
| 24
| 32
Specify the size of the red difference component in the input video stream. The
value of this parameter determines the interpretation of the video stream data as
8
-bit, 16
-bit, 24
-bit, or
32
-bit.
To enable this parameter, set the Video format parameter to
Custom
, and set the Number of inputs
parameter to 3
or greater, and select the Inherit
size of components from input data type parameter.
Bits4
— Size of alpha component8
(default) | 0
| 16
| 24
| 32
Specify the size of the alpha component in the input video stream. The value of this
parameter determines the interpretation of the video stream data as
8
-bit, 16
-bit, 24
-bit, or
32
-bit.
To enable this parameter, set the Video format parameter to
Custom
, and set the Number of inputs
parameter to 4
, and select the Inherit size of
components from input data type parameter.
Component order in binary file
— Arrangement of components in binary file1 2 3
] (default) | vector of valid component identifiersSpecify the arrangement of the components in the binary file. Identify the components by the assigned numerals, from 1 to 4, in the desired order. You must include all enabled components when setting this parameter.
To enable this parameter, set the Video format parameter to
Custom
.
Interlaced video
— Read video data as interlacedoff
(default) | on
Select this parameter when the video stream contains interlaced video data.
To enable this parameter, set the Video format parameter to
Custom
.
Write signed data to output file
— Write signed data to output binary fileoff
(default) | on
Select this parameter when the input data is signed.
To enable this parameter, set the Video format parameter to
Custom
.
Byte order in binary file
— Byte order in output binary fileLittle endian
(default) | Big endian
Specify the byte order in the output binary file as either little endian or big endian.
To enable this parameter, set the Video format parameter to
Custom
.
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Four Character Code | Input ports |
---|---|
I420 | Y'|Cb|Cr |
AYUV | Y'|Cb|Cr|A |
CLJR | Y'|Cb|Cr |
cyuv | Y'|Cb|Cr |
GREY | Y' |
IF09 | Y'|Cb|Cr|A |
IMC1 | Y'|Cb|Cr |
IMC2 | Y'|Cb|Cr |
IMC3 | Y'|Cb|Cr |
IMC4 | Y'|Cb|Cr |
IUYV | Y'|Cb|Cr |
IY41 | Y'|Cb|Cr |
IYU1 | Y'|Cb|Cr |
IYU2 | Y'|Cb|Cr |
IYUV | Y'|Cb|Cr |
NV12 | Y'|Cb|Cr |
NV21 | Y'|Cb|Cr |
UYNV | Y'|Cb|Cr |
UYNY | Y'|Cb|Cr |
V210 | Y'|Cb|Cr |
Y411 | Y'|Cb|Cr |
Y41P | Y'|Cb|Cr |
Y41T | Y'|Cb|Cr|T |
Y422 | Y'|Cb|Cr |
Y42T | Y'|Cb|Cr|T |
Y8 | Y' |
Y800 | Y' |
YUNV | Y'|Cb|Cr |
YUY2 | Y'|Cb|Cr |
YUYV | Y'|Cb|Cr |
YV12 | Y'|Cb|Cr |
YV16 | Y'|Cb|Cr |
YVU9 | Y'|Cb|Cr |
YVYU | Y'|Cb|Cr |