Write Binary File

Write binary video data to files

Library

Sinks

visionsinks

Description

The Write Binary File block takes 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. You cannot use this block to do code generation with Real-Time Windows Target™ (RTWin).

PortInputSupported Data TypesComplex Values Supported

Input

Matrix that represents the luma (Y') and chroma (Cb and Cr) components of a video stream

  • 8-, 16- 32-bit signed integer

  • 8-, 16- 32-bit unsigned integer

No

Four Character Code Video Formats

Four Character Codes (FOURCC) identify video formats. For more information about these codes, see http://www.fourcc.org.

Use the Four character code parameter to identify the video format.

Custom Video Formats

You can use the Write Binary File block to create a binary file that contains video data in a custom format.

  • Use the Bit stream format parameter to specify whether you want your data in planar or packed format.

  • Use the Number of input components parameter to specify the number of components in the video stream. This number corresponds to the number of block input ports.

  • Select the Inherit size of components from input data type check box if you want each component to have the same number of bits as the input data type. If you clear this check box, you must specify the number of bits for each component.

  • Use the Component parameters to specify the component names.

  • Use the Component order in binary file parameter to specify how to arrange the components in the binary file.

  • Select the Interlaced video check box if the video stream represents interlaced video data.

  • Select the Write signed data to output file check box if your input data is signed.

  • Use the Byte order in binary file parameter to specify whether the byte ordering in the output binary file is little endian or big endian.

Dialog Box

The Write Binary File dialog box appears as shown in the following figure.

File name

Specify the name of the binary file. To specify a different file or location, click the Save As... button.

Video format

Specify the format of the binary video data as eitherFour character codes or Custom. See Four Character Code Video Formats or Custom Video Formats for more details.

Four character code

From the list, select the binary file format.

Line ordering

Specify how the block fills the binary file. If you select Top line first, the block first fills 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 first fills 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

Specify whether you want your data in planar or packed format.

Number of input components

Specify the number of components in the video stream. This number corresponds to the number of block input ports.

Inherit size of components from input data type

Select this check box if you want each component to have the same number of bits as the input data type. If you clear this check box, you must specify the number of bits for each component.

Component

Specify the component names.

Component order in binary file

Specify how to arrange the components in the binary file.

Interlaced video

Select this check box if the video stream represents interlaced video data.

Write signed data to output file

Select this check box if your input data is signed.

Byte order in binary file

Use this parameter to specify whether the byte ordering in the output binary file is little endian or big endian.

See Also

Read Binary File

Computer Vision System Toolbox™

To Multimedia File

Computer Vision System Toolbox

Was this topic helpful?