FUNCTION REFERENCE
VideoWriter
Create a shared handle for a video writer.
Create a shared handle for a video writer.
Syntax
w = VideoWriter(filename)Syntax
w = VideoWriter(filename, profile)Default profile is 'Motion JPEG AVI'; also supports 'Uncompressed AVI', 'Grayscale AVI' and 'Indexed AVI'. With ffmpeg available, also supports 'MPEG-4' (.mp4), 'Motion JPEG 2000' (.mj2, lossy) and 'Archival' (.mj2, lossless). Missing extensions use the selected profile's extension. VideoWriter.getProfiles() adds these profiles only when ffmpeg is found. Read-only properties: Filename, Path, FileFormat, ColorChannels, VideoBitsPerPixel, VideoCompressionMethod, VideoFormat, Height, Width, FrameCount and Duration. Set FrameRate (default 30), Quality (integer 0 to 100, default 75, MJPEG or MPEG-4 only) and Colormap (indexed only) before open. Height and Width are fixed by the first frame. Copies share writing state. JPEG 2000 profiles expose LosslessCompression (Archival defaults true), CompressionRatio (integer >1, default 10, set only while lossy), and MJ2BitDepth (this slice supports 8 or 16 only). Set profile properties before open.
Example
w=VideoWriter('example.avi'); w.FrameRate % 30Example
p=VideoWriter.getProfiles(); p(1).Name % Motion JPEG AVIDifferences from MATLAB: constant-rate output; MPEG-4 uses libx264/yuv420p when available and falls back to mpeg4. JPEG 2000 requires libopenjpeg or jpeg2000. MPEG-4 odd dimensions are padded on the right/bottom to even dimensions. Profiles are struct records rather than ProfileInfo objects; FileExtensions is a character vector. Dimensions are limited to 32767, FrameRate to [0.001,4294], movi data to 1 GiB, and frame count to 1000000. Indexed palettes are padded to 256 entries on disk. No audio or GUI. External encoders use bounded rawvideo pipes and temporary files beside the destination; successful close publishes the file. Errors/cancellation discard external output and preserve an existing destination. Executable discovery follows VideoReader.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.