| Video and Image Processing Blockset™ | ![]() |
Sinks

The Write Binary File block takes video data from a Simulink® model and exports it to a binary file.
Note This block supports code generation for platforms that have file I/O available. This excludes RTWin (Real-Time Windows Target™). |
| Port | Input | Supported Data Types | Complex Values Supported |
|---|---|---|---|
Input | Matrix that represents the luma (Y') and chroma (Cb and Cr) components of a video stream |
| No |
Use the File name parameter to specify the name of the binary file. If the location of this file is on your MATLAB® path, enter the filename. If the location of this file is not on your MATLAB path, use the Browse button to specify the full path to the file as well as the filename.
Use the Video format parameter to specify the format of the binary video data. Your choices are Four character codes or Custom. See Four Character Code Video Formats or Custom Video Formats for more details.
Use the Line ordering parameter to determine 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 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 fills the file with the other rows in decreasing order.
Four Character Codes (FOURCC) are used to 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.
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.
The Write Binary File dialog box appears as shown in the following figure.

Specify the name of the binary file.
Specify the format of the binary video data. Your choices are Four character codes or Custom.
From the list, select the binary file format.
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. If you select Bottom line first, the block first fills the binary file with the last row of the video frame.

Specify whether you want your data in planar or packed format.
Specify the number of components in the video stream. This number corresponds to the number of block input ports
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.
Specify the component names.
Specify how to arrange the components in the binary file.
Select this check box if the video stream represents interlaced video data.
Select this check box if your input data is signed.
Use this parameter to specify whether the byte ordering in the output binary file is little endian or big endian.
Video and Image Processing Blockset | |
Video and Image Processing Blockset |
![]() | Write AVI File (Obsolete) | Function Reference | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |