Write video frames and audio samples to multimedia file
The To Multimedia File block writes video frames, audio samples, or both to a multimedia (.avi, .wav, .wma, or .wmv) file.
You can compress the video frames or audio samples by selecting a compression algorithm. You can connect as many of the input ports as you want. Therefore, you can control the type of video and/or audio the multimedia file receives.
Note This block supports code generation for platforms that have file I/O available. You cannot use this block with Real-Time Windows Target™ software, because that product does not support file I/O.
This block performs best on platforms with Version 11 or later of Windows Media® Player software. This block supports only uncompressed RGB24 AVI files on Linux® and Mac platforms.
Windows® 7 UAC (User Account Control), may require administrative privileges to encode WMV and WMA files.
The generated code for this block relies on prebuilt library files. You can run this code outside the MATLAB® environment, or redeploy it, but be sure to account for these extra library files when doing so. The packNGo function creates a single zip file containing all of the pieces required to run or rebuild this code. See packNGo for more information.
To run an executable file that was generated from a model containing this block, you may need to add precompiled shared library files to your system path. See Simulink Coder, Shared Library Dependencies, and Accelerating Simulink Models for details.
This block allows you to write WMA/WMV streams to disk or across a network connection. Similarly, the From Multimedia File block allows you to read WMA/WMV streams to disk or across a network connection. If you want to play an MP3/MP4 file in Simulink®, but you do not have the codecs, you can re-encode the file as WMA/WMV, which are supported by the Computer Vision System Toolbox™.
M-by-N-by-3 matrix RGB, Intensity, or YCbCr 4:2:2 signal.
R, G, B
Matrix that represents one plane of the RGB video stream. Inputs to the R, G, or B port must have the same dimensions and data type.
Vector of audio data
Y, Cb, Cr
Matrix that represents one frame of the YCbCr video stream. The Y, Cb, and Cr ports use the following dimensions:
The Main pane of the To Multimedia File block dialog appears as follows.
Specify the name of the multimedia file. The block saves the file in your current folder. To specify a different file or location, click the Save As... button.
Specify the file type of the multimedia file. You can select avi, wav, wma, or wmv.
Specify whether the block writes video frames, audio samples, or both to the multimedia file. You can select Video and audio, Video only, or Audio only.
Select the type of compression algorithm to use to compress the audio data. This compression reduces the size of the multimedia file. Choose None (uncompressed) to save uncompressed audio data to the multimedia file.
Select the audio data type. You can use the Audio data type parameter only for uncompressed wave files.
Select the type of compression algorithm to use to compress the video data. This compression reduces the size of the multimedia file. Choose None (uncompressed) to save uncompressed video data to the multimedia file.
Select the color format of the data stored in the file. You can select either RGB or YCbCr 4:2:2.
Specify how the block accepts a color video signal. If you select One multidimensional signal, the block accepts an M-by-N-by-P color video signal, where P is the number of color planes, at one port. If you select Separate color signals, additional ports appear on the block. Each port accepts one M-by-N plane of an RGB video stream.
For the block to display video data properly, double- and single-precision floating-point pixel values must be between 0 and 1. Any other data type requires the pixel values between the minimum and maximum values supported by their data type.
Check the specific codecs you are using for supported audio rates.
|Port||Supported Data Types||Supports Complex Values?|
R, G, B
Same as Image port
Y, Cb, Cr
Same as Image port
|From Multimedia File||Computer Vision System Toolbox|