Version (4.38 KB) by Jan
VideoReader using FFMPEG
Updated 10 Aug 2017

MATLAB wrapper for FFMPEG that implements a VideoReader-like interface
vr = VideoReaderFFMPEG('test.mp4');
Additional arguments:
tempFolder - path to save the temporary image files to (optional, defaults to ./)
FFMPEGpath - path to the ffmpeg and ffprobe binaries (optional, defaults to /usr/local/bin on osx/unix and C:\Program Files\ffmpeg\bin on windows)
imageFormat - image file format used to temporarily store frames (optional, defauts to tif)
Properties: Width, Height, NumberOfFrames, FrameRate, Channels
- read() with single frames or a range of frames [startFrame endFrame], e.g.[100 200]) reads frames 100 to 200, returns them as [WIDTH x HEIGHT x CHANNELS x NFRAMES] matrix
- clean() deletes all temporary image files (automatically called upon object deletion)
vr = VideoReaderFFMPEG('test.mp4') % open video file
frame10 = % read frame 10
frames100to200 =[100 200]) % read frames 100 to 200
vr.clean() % delete temporary image files after you're done

- uses ffprobe to get meta data
- uses ffmpeg to export video frames as images which are loaded using matlab's imread()
- tested using ffmpeg v2.5 and v2.6

Cite As

Jan (2024). postpop/VideoReaderFFMPEG (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

fixed typo
added description
cleaned up repo

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.