Bug with VideoReader class using R2019a
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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)
0 Kommentare
Antworten (1)
Margaret Pinson
am 30 Jul. 2019
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.
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!