Matlab wrapper for FFMPEG that implements a VideoReader-like interface.
- Constructor:
vr = VideoReaderFFMPEG('test.mp4'); - Additional arguments (optional):
tempFolder- path to save the temporary image files to (optional, defaults to./)FFMPEGpath- path to theffmpegandffprobebinaries (optional, defaults to/usr/local/binon osx/unix andC:\Program Files\ffmpeg\binon windows)imageFormat- image file format used to temporarily store frames (optional, defauts totif)
- Properties:
Width,Height,NumberOfFrames,FrameRate,Channels - Methods:
read()with single frames or a range of frames[startFrame endFrame], e.g.vr.read([100 200])reads frames 100 to 200, returns them as[WIDTH x HEIGHT x CHANNELS x NFRAMES]matrixclean()deletes all temporary image files (automatically called upon object deletion)
vr = VideoReaderFFMPEG('test.mp4') % open video file
frame10 = vr.read(10) % read frame 10
frames100to200 = vr.read([100 200]) % read frames 100 to 200
vr.clean() % delete temporary image files after your done
- uses
ffprobeto get meta data - uses
ffmpegto export video frames as images which are loaded using matlab'simread() - tested using
ffmpegv2.5 and v2.6