| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Video and Image Processing Blockset |
| Contents | Index |
| Learn more about 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.
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 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 |
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.
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. 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 including the filename.
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.
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. 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.

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 | |
Signal Processing Blockset |
![]() | Write AVI File (Obsolete) | Function Reference | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |