FUNCTION REFERENCE
VideoReader
Create a shared handle for a local video stream.
Create a shared handle for a local video stream.
Syntax
v = VideoReader(filename)Syntax
v = VideoReader(filename, 'CurrentTime', t, 'Tag', tag, 'UserData', data)Reads the first video stream of RIFF AVI and OpenDML AVI/AVIX. Supports baseline Motion JPEG (MJPG, mjpg, AVRn, dmb1), including standard-table AVI1 frames without DHT, and BI_RGB 24-bit BGR, 32-bit BGRX and 8-bit palettes. Read-only properties: Name, Path, Duration, FrameRate, NumFrames, Height, Width, BitsPerPixel, VideoFormat and Colormap. CurrentTime, Tag and UserData are writable. Copies share the same playback position. Native AVI files remain closed between reads. Other containers and AVI codecs use ffmpeg and ffprobe executables on PATH, or the absolute executable paths in MATRUST_FFMPEG and MATRUST_FFPROBE (also settable with setenv). Relative overrides are errors; empty overrides clear the override. Empty and relative PATH entries are skipped; the current folder is never searched implicitly. No executable is linked or bundled. Tool lookup is cached per engine; changing PATH or an override resets the lookup. VideoReader.getFileFormats() adds common ffmpeg formats when ffmpeg is found, with Extension, Description, ContainsVideo and ContainsAudio fields. Missing tools produce an explicit error.
Example
f=VideoReader.getFileFormats(); f(1).Extension % aviDifferences from MATLAB: local files only, no audio decoding or remote files. The format list contains struct records rather than FileFormatInfo objects. ffmpeg output is uint8 RGB24 or Grayscale, including high-bit-depth inputs. Metadata capture is limited to 1 MiB; unknown frame counts require a full ffprobe -count_frames pass (potentially expensive). Pipe operations and tool exit time out after 10 seconds; stderr is capped at 32 KiB. Sequential readFrame reuses one streaming child; seeking and indexed reads restart it. This backend is unavailable in wasm builds. Indexed read preserves CurrentTime here; MATLAB R2026b updates it. Progressive JPEG and interlaced JPEG fields are not supported.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.