Main Content

Read Video Stored as Binary Data

This example shows how to read a video data stored in binary format by using the Read Binary File block.

Example Model

Open the Simulink model.

modelname = 'ex_blkreadbinaryfile.slx';
open_system(modelname);

The model reads the binary file specified as 'vipmen.bin' in the File name parameter of the Read Binary File block. The file is played until the end of the simulation because the Number of times to play file parameter of the Read Binary File block is set to inf.

Simulate and Display Results

Run the simulation.

sim(modelname);

The model returns the luminance, blue difference, and red difference components of the input video stored as binary data. The Read Binary File block exports the binary data to the MATLAB workspace as video data with a frame size of 120-by-160 pixels. The Video Viewer blocks display the components of the binary data.