In this example, you use the To Multimedia File block, the Enabled Subsystem block, and a trigger signal, to save portions of one AVI file to three separate AVI files.
You can open the example model with the link below or by typing
at the MATLAB® command line.
The block parameters in this example were modified from default values as follows:
|From Multimedia File||The From Multimedia File block imports an AVI
file into the model. |
|Insert Text||The example uses the Insert Text block to annotate
the video stream with frame numbers. The block writes the frame number
in green, in the upper-left corner of the output video stream.|
|To Multimedia File|
The To Multimedia File blocks send the video stream to three separate AVI files. These block parameters were modified as follows:
The Counter block counts the number of video frames. The example uses this information to specify which frames are sent to which file. The block parameters are modified as follows:
The bias block adds a bias to the input. The block parameters are modified as follows:
|Compare to Constant|
The Compare to Constant block sends frames 1 to 9 to the first AVI file. The block parameters are modified as follows:
|Compare to Constant1|
Compare to Constant2
The Compare to Constant1 and Compare to Constant2 blocks send frames 10 to 19 to the second AVI file. The block parameters are modified as follows:
The Compare to Constant2 block parameters are modified as follows:
|Compare to Constant3|
The Compare to Constant3 block send frames 20 to 30 to the third AVI file. The block parameters are modified as follows:
|Compare to Constant4|
The Compare to Constant4 block stopa the simulation when the video reaches frame 30. The block parameters are modified as follows:
Each To Multimedia File block gets inserted into one Enabled Subsystem block, and connected to it's input. You can do this, by double-clicking the Enabled Subsystem blocks, then click-and-drag a To Multimedia File block into it.
Each enabled subsystem should look similar to the subsystem shown in the following figure.