Main Content

Read and Display RGB Video from File

This example shows you how to read video frames from a multimedia file as their separate red, green, and blue components, and then display the video frames.

Example Model

Open the Simulink® model.

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

The model reads an input video file using a From Multimedia File block with these parameters:

  • File namevippedtracking.mp4

  • Output color formatRGB

  • Image signalSeparate color signals

The model displays the video frames using a Video Viewer block with the Separate Color Signals parameter enabled. The R, G, and B ports of each block represent the red, green and blue color channels, respectively, of the input video frames.

Simulate the Model

Run the model. The model displays the video frames in a viewer window.

sim(modelname);