VideoReaderAsync
Versione 1.0.2 (9,8 KB) da
Brian Kardon
An asynchronous video reader using ffmpeg as the back-end decoder
This is a video reader class that reads audio/video files and loads them into memory as an RGB array. It was written to overcome problems due to slow, blocking loading with MATLAB's built in video-reading utilities.
It provides a variety of useful functionality, such as callbacks for reacting to data loading events, and an optional GUI progress bar.
Note that using this class requires that ffmpeg (open source video encoding/decoding software) is installed and available on the system path. If you open a terminal, type "ffmpeg" and get an error, then VideoReaderAsync will not work. See https://ffmpeg.org/download.html to get ffmpeg. ffprobe is also required, but is typically bundled with ffmpeg.
Example usage:
f = 'path/to/video/file.avi';
vr = VideoReaderAsync(f, 'FramesReceivedCallback', @(src, evt)disp(evt));
while ~vr.Loaded
% Video will continue to load in the background while we do other things
% The callback will be called every time another chunk of frames finish loading.
pause(1);
end
% Display the first frame of video
imshow(vr.VideoData(:, :, :, 1));
Cita come
Brian Kardon (2025). VideoReaderAsync (https://it.mathworks.com/matlabcentral/fileexchange/177014-videoreaderasync), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2022b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxTag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
