フィルターのクリア

VideoReader: Unrecognized function or variable 'hasFrame'

44 ビュー (過去 30 日間)
Alexander Brandt
Alexander Brandt 2024 年 7 月 23 日 18:10
移動済み: Walter Roberson 2024 年 7 月 23 日 23:01
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 件のコメント
Alexander Brandt
Alexander Brandt 2024 年 7 月 23 日 19:14
@Walter Roberson It gives me:
Methods for class VideoWriter:
VideoWriter delete open set
close get saveobj writeVideo
Static methods:
getProfiles
Methods of VideoWriter inherited from handle
It doesn't list hasFrame as one of the methods for the class.
Avni Agrawal
Avni Agrawal 2024 年 7 月 23 日 19:22
MATLAB Version: 24.1.0.2537033 (R2024a)
Operating System: Microsoft Windows 11 Enterprise Version 10.0 (Build 22631)

サインインしてコメントする。

採用された回答

Avni Agrawal
Avni Agrawal 2024 年 7 月 23 日 19:41
移動済み: Walter Roberson 2024 年 7 月 23 日 23:01
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 件のコメント
Alexander Brandt
Alexander Brandt 2024 年 7 月 23 日 20:17
移動済み: Walter Roberson 2024 年 7 月 23 日 23:01
@Avni Agrawal That resolved it, thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by