To Multimedia File
Stream video frames and audio samples to multimedia file
Libraries:
Audio System Toolbox /
Sinks
DSP System Toolbox /
Sinks
Description
The To Multimedia File block writes video frames, audio samples, or
both to a multimedia (.avi
, .wav
,
.wma
, .mp4
, .ogg
,
.flac
, .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 Simulink® Desktop Real-Time™ 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) might 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
(Simulink Coder) 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 Understanding C Code Generation in DSP System Toolbox for details.
Examples
Ports
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.
Input
Parameters
Block Characteristics
More About
Tips
To run your generated standalone executable application in Shell, set your environment using these commands.
Platform | Command |
---|---|
Mac |
For more information, see Append library path to "DYLD_LIBRARY_PATH" in MAC. |
Linux |
|
Windows |
|