| 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 |
vipobslib

Note The Read AVI File block is obsolete. It may be removed in a future version of the Video and Image Processing Blockset blocks. Use the replacement block From Multimedia File. |
The Read AVI File block reads video frames from an uncompressed AVI file and import them into a Simulink model. You can view the video frames using a To Video Display block or Video Viewer block. This block does not support audio samples. Also, this block is supported for simulation only. It produces an error during Real-Time Workshop code generation.
The output ports of the Read AVI File block change according the content of the AVI file. If the file contains RGB video frames, the R, G, and B ports appear on the block. If the file contains intensity video frames, the I port appears on the block.
| Port | Output | Supported Data Types | Complex Values Supported |
|---|---|---|---|
I | Scalar, vector, or matrix of intensity values |
| No |
R, G, B | Scalar, vector, or matrix that represents one plane of the RGB video stream. Outputs from the R, G, or B ports have the same dimensions. | Same as I port | No |
EOF | Scalar value | Boolean | No |
Use the File name parameter to specify the name of the AVI file from which to read. 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.
If filename.avi has a colormap associated with it, the AVI file must satisfy the following conditions or the block produces an error:
The colormap must be empty or have 256 values.
The data must represent an intensity image.
The pixel values must be 8-bit.
Use the Video output data type parameter to set the data type of the values output from the block. You can choose double, single, int8, uint8, int16, uint16, int32, uint32, and Inherit from file. If you choose double or single, the block scales the input pixels values and outputs values between 0 and 1. If you choose int8, uint8, int16, uint16, int32, or uint32, the blocks scales the input pixel values and outputs values between the minimum and maximum values supported by the chosen data type. If you choose Inherit from file, the block does not scale the input pixel values.
Use the Number of times to play file parameter to enter the number of times to play the file. The number you enter must be a positive integer or inf, to play the file until you stop the simulation.
Use the Output end-of-file indicator parameter to determine when the last video frame in the AVI file is output from the block. When you select this check box, a Boolean output port labeled EOF appears on the block. The output from the EOF port is 1 when the last video frame is output from the block. Otherwise, the output from the EOF port is 0.
The Read AVI File dialog box appears as shown in the following figure.

Specify the name of the AVI file from which to read.
Set the data type of the video data output from the block.
Enter a positive integer or inf to represent the number of times to play the file.
Use this check box to determine whether the output is the last video frame in the AVI file.
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Signal Processing Blocksetsoftware | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software |
![]() | PSNR | Read Binary File | ![]() |

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 |