FUNCTION REFERENCE

read

Read VideoReader frames by one-based index without changing CurrentTime.

Read VideoReader frames by one-based index without changing CurrentTime.

Syntax

frames = read(v)

Syntax

frame = read(v, k)

Syntax

frames = read(v, [first last])

Syntax

frames = read(v, [first Inf], 'native')

Reads all frames by default; Inf selects the last frame. RGB results are H-by-W-by-3-by-F uint8 and grayscale results H-by-W-by-1-by-F uint8, with trailing singleton dimensions omitted. Native indexed or grayscale output is a 1-by-F struct array with cdata and colormap. Output and decoder scratch are checked against the evaluation memory limit before allocating; use ranges for larger files.

Example

f=VideoReader.getFileFormats(); f(1).Description

Differences from MATLAB: read preserves CurrentTime by this slice's explicit contract; MATLAB R2026b updates it to the frame after the last one read. See VideoReader for supported formats.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.