Bug with VideoReader class using R2019a

2 ビュー (過去 30 日間)
Valentin Doguet
Valentin Doguet 2019 年 4 月 23 日
回答済み: Margaret Pinson 2019 年 7 月 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.

Community Treasure Hunt

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

Start Hunting!

Translated by