Main Content

Write Binary File

Write binary video data to file

  • Library:
  • 计算机视觉工具箱/ Sinks

  • Write Binary File block

Description

TheWrite Binary Fileblock 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 usingSimulink Desktop Real-Time™orSimulink Real-Time™.

Ports

Input

expand all

Luminance component of the input video stream, specified as a scalar, vector, or matrix. The label of this port can be changed using theComponent1parameter when theVideo formatparameter is set toCustom.

Data Types:int8|int16|int32|uint8|uint16|uint32

Blue difference component of the input video stream, specified as a scalar, vector, or matrix. The label of this port can be changed using theComponent2parameter when theVideo formatparameter is set toCustom.

Data Types:int8|int16|int32|uint8|uint16|uint32

Red difference component of the input video stream, specified as a scalar, vector, or matrix. The label of this port can be changed using theComponent3parameter when theVideo formatparameter is set toCustom.

Data Types:int8|int16|int32|uint8|uint16|uint32

Alpha component of the input video stream, specified as a scalar, vector, or matrix. The label of this port can be changed using theComponent4parameter when theVideo formatparameter is set toCustom.

Dependencies

To enable this port, use one of these options.

  • Set theVideo formatparameter toFour character codes, and set theFour character codeparameter toAYUVorIF09.

  • Set theVideo formatparameter toCustom, and theNumber of inputsparameter to4. In this case, the name of this port isAlpha.

Data Types:int8|int16|int32|uint8|uint16|uint32

Transparency component of the input video stream, specified as a scalar, vector, or matrix.

Dependencies

To enable this port, set theVideo formatparameter toFour character codes, and set theFour character codeparameter toY41TorY42T.

Data Types:int8|int16|int32|uint8|uint16|uint32

Parameters

expand all

Specify the name of the output binary file, with a.binextension, for the video data. ClickSave Asto specify the location for the file.

Specify the format of the video data as one of these options.

  • Four character codes (FOURCC) — For more information about these codes, seehttps://www.fourcc.org.

  • Custom — Read the video data from a binary file of a custom format.

选择的四个字符代码所需的代码c 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, seeInput Ports for Four Character Codes.

Dependencies

To enable this parameter, set theVideo Formatparameter toFour character codes.

If you selectTop 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 selectBottom 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.

Specify the data format of the binary file asPlanarorPacked.

Dependencies

To enable this parameter, set theVideo Formatparameter toCustom.

Specify the number of components in the input video stream. This parameter sets the number of input ports.

Dependencies

To enable this parameter, set theVideo Formatparameter toCustom.

Select theInherit size of components from input data typeparameter 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 associatedBitsparameter.

Dependencies

To enable this parameter, set theVideo Formatparameter toCustom.

Specify the name of the input port for the luminance component of the input video stream.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, set theNumber of inputsparameter to1or greater .

Specify the name of the input port for the blue difference component of the input video stream.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, set theNumber of inputsparameter to2or greater .

Specify the name of the input port for the red difference component of the input video stream.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, set theNumber of inputsparameter to3or greater .

Specify the name of the input port for the alpha component of the input video stream.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, set theNumber of inputsparameter to4.

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 as8-bit,16-bit,24-bit, or32-bit.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, and set theNumber of inputsparameter to1or greater, and select theInherit size of components from input data typeparameter.

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 as8-bit,16-bit,24-bit, or32-bit.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, and set theNumber of inputsparameter to2or greater, and select theInherit size of components from input data typeparameter.

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 as8-bit,16-bit,24-bit, or32-bit.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, and set theNumber of inputsparameter to3or greater, and select theInherit size of components from input data typeparameter.

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 as8-bit,16-bit,24-bit, or32-bit.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom, and set theNumber of inputsparameter to4, and select theInherit size of components from input data typeparameter.

Specify 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.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom.

Select this parameter when the video stream contains interlaced video data.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom.

Select this parameter when the input data is signed.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom.

Specify the byte order in the output binary file as either little endian or big endian.

Dependencies

To enable this parameter, set theVideo formatparameter toCustom.

Block Characteristics

Data Types

integer

Multidimensional Signals

no

Variable-Size Signals

no

Input Ports for Four Character Codes

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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced before R2006a