VideoReaderAsync

版本 1.0.2 (9.8 KB) 作者: Brian Kardon
An asynchronous video reader using ffmpeg as the back-end decoder
7.0 次下载
更新时间 2024/12/7

查看许可证

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));

引用格式

Brian Kardon (2025). VideoReaderAsync (https://www.mathworks.com/matlabcentral/fileexchange/177014-videoreaderasync), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2022b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.2

Improved example code

1.0.1

Added example usage to description.

1.0.0