Skip to content

VideoWriter

multimedia · scripts/multimedia/VideoWriter.m

VIDEOWRITER  Write frames to a video file.

  v = VideoWriter (filename)
  v = VideoWriter (filename, profile)
  open (v);  writeVideo (v, frame);  close (v);

  Frames are written as uncompressed 24-bit AVI.  The profiles
  'Uncompressed AVI', 'Motion JPEG AVI' and 'Archival' all produce that
  container (Nexus has no MJPEG / JPEG 2000 / H.264 encoder), and a file
  name without extension gets '.avi'.  A frame is a struct with a cdata
  field (as returned by getframe), an m-by-n-by-3 / m-by-n image, or a
  height-by-width-by-3-by-F / height-by-width-by-1-by-F array, uint8 or
  double in [0, 1].

  Call open before writeVideo (MATLAB R2026a).  Error identifiers use the
  MATLAB:audiovideo:VideoWriter:* catalog.