VideoReader: Unrecognized function or variable 'hasFrame'
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alexander Brandt
am 23 Jul. 2024
Verschoben: Walter Roberson
am 23 Jul. 2024
I am following the VideoReader documentation from https://www.mathworks.com/help/matlab/ref/videoreader.html
When I try to run the example code using R2024a Update 5,
currAxes = axes;
v = VideoReader("xylophone_video.mp4");
while hasFrame(v)
vidFrame = readFrame(v);
image(vidFrame,"Parent",currAxes)
currAxes.Visible = "off";
pause(1/v.FrameRate)
end
the line with while hasFrame(v) throws an error: Unrecognized function or variable 'hasFrame'.
The VideoReader object was created, but the hasFrame(v) line does not work. Was support for this function removed? If so, what replaced it?
5 Kommentare
Avni Agrawal
am 23 Jul. 2024
MATLAB Version: 24.1.0.2537033 (R2024a)
Operating System: Microsoft Windows 11 Enterprise Version 10.0 (Build 22631)
Akzeptierte Antwort
Avni Agrawal
am 23 Jul. 2024
Verschoben: Walter Roberson
am 23 Jul. 2024
You are trying to access VideoWriter instead of VideoReader. Are you sure the code you are trying to run has VideoReader() but not VideoWriter() ?
Because, methods(v) is returning:
Methods for class VideoReader:
VideoReader hasFrame read saveobj
get inspect readFrame set
Static methods:
getFileFormats
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!