Bug with VideoReader class using R2019a

2 次查看(过去 30 天)
Hi all,
The following script worked perfectly fine with Matlab R2018b under a PC machine. I now installed version R2019a and the script remains busy for a while after the first third of my video, without trhowing error or crash report. I did try with the same video and another old Matlab version, the script works.
I assume there's some bugs with the last Matlab R219a version, and this might be one if these.
Am I right?
Thank you.
Valentin
filePath = 'test.avi';
%Create video Object
movObj = VideoReader(filePath);
%Get some properties
duration = movObj.Duration;
height = movObj.Height;
width = movObj.Width;
nbF = movObj.NumberOfFrame;
%Recreate the object since we called NumberOfFrame method
movObj = VideoReader(filePath);
%Allocate enough memory for all frames to import
frames = zeros(height, width, 3, nbF, 'uint8');
%Get frame one-by-one
waitB = waitbar(0, 'Read Frames');
i = 1;
while hasFrame(movObj)
%Get the next frame
frames(:, :, :, i) = readFrame(movObj);
i = i + 1;
%Update waitbar if any
if exist('waitB', 'var') && isvalid(waitB)
waitbar(movObj.CurrentTime/movObj.Duration, waitB)
end
end
delete(waitB)

回答(1 个)

Margaret Pinson
Margaret Pinson 2019-7-30
I am also having problems with VideoReader, hasFrame, and readFrame in MATLAB 2019a. There are inconsistencies where the first frame is read twice or the last frame won't read.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by