Description VideoWriter objects allow you to create video files from arrays or MATLAB® movies. You can use the VideoWriter function with a predefined profile to create a VideoWriterobject with properties tailored to a specific format, such as 'Uncompressed AVI' or 'MPEG‐4'. After you create the object, you can use dot notation to view or modify a particular property: v = VideoWriter('newfile.mj2','Motion JPEG 2000'); v.CompressionRatio = 3;
Modify property values before opening the video file for writing. After you call the openfunction, you cannot change the value of a property.
Examples
expand all
Create VideoWriter Object and Write Video Specify Profile for Uncompressed AVI and Write Video Create AVI File from Animation
Properties ColorChannels — Number of color channels positive integer Colormap — Color information for video file Pby3 numeric matrix CompressionRatio — Target compression ratio 10 (default) | integer greater than 1 Duration — Duration of output file scalar value FileFormat — Type of file to write 'avi' | 'mp4' | 'mj2' Filename — Name of file string FrameCount — Number of frames integer FrameRate — Rate of video playback 30 (default) | positive number Height — Height of each video frame scalar LosslessCompression — Lossless compression true | false MJ2BitDepth — Bit depth for Motion JPEG 2000 files integer in the range [1,16] Path — Full path to video file string Quality — Video quality 75 (default) | integer in the range [0,100] VideoBitsPerPixel — Number of bits per pixel numeric scalar VideoCompressionMethod — Type of video compression 'None' | 'H.264' | 'Motion JPEG' | 'Motion JPEG 2000'
expand all
VideoFormat — MATLAB representation of video format string Width — Width of each video frame numeric scalar
Object Functions open
Open file for writing video data
close
Close file after writing video data
writeVideo
Write video data to file
VideoWriter.getProfile Profiles and file formats that VideoWriter supports s
Create Object Create VideoWriter objects using the VideoWriter function.
More About Export to Video
Introduced in R2010b
Write video files - MATLAB.pdf
Write video files - MATLAB.pdf. Write video files - MATLAB.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Write video files - MATLAB.pdf.