Error using VideoReader/hasFrame Method 'hasFrame' is not defined for class 'VideoReader' or is removed from MATLAB's search path.
1 次查看(过去 30 天)
显示 更早的评论
Hello I can't get the frames from an avi file, I don't know what's happen. the code is
%%crea directorio donde guardar
workingDir = tempname;
mkdir(workingDir)
mkdir(workingDir,'images')
VideoName = VideoReader('vid1.avi');%%%Acá reemplazar por el nombre real del video con extensión .avi
ii = 1; %%%contador
while hasFrame(VideoName)
img = readFrame(VideoName); %%%lee el cuadro
filename = [sprintf('%03d',ii) '.png']; %%%crea nombre y fija el formato Puede ser .jpg,.bmp, etc
fullname = fullfile(workingDir,'images',filename); %%%crea directorio
imwrite(img,fullname) %%%Graba la imagen a el formato elegido(img1.jpg, img2.jpg, etc.)
imwrite(img, sprintf('captured%.3d.png', ii));
ii = ii+1;
end
3 个评论
mumtaz
2019-9-21
Has anyone got the solution of this problem? I am using R2018b and R2019a. both show this error.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!