VideoReader in App Designer

How do I use VideoReader in app designer to display video on a UIAxes?

답변 (1개)

OCDER
OCDER 2018년 7월 11일
편집: OCDER 2018년 7월 12일

0 개 추천

I'm guessing you're familiar with callbacks in app designer? If not, here's the tutorial.
>> appdesigner.internal.application.openTutorial('BasicCoding')
In the callback function for the button that will read the video image, do something like this:
filename = 'myvideo.mp4';
v = VideoReader(filename);
while hasFrame(v)
imshow(getFrame(v), 'Parent', app.UIAxes);
end

댓글 수: 5

T.A.S.
T.A.S. 2018년 7월 12일
I get "error using getframe a valid figure or axes handle must be defined"
OCDER
OCDER 2018년 7월 12일
Oops, it should have been readFrame, not getFrame. I edited the answer above.
There's a capital "F" in readFrame.
readFrame(v)
^
T.A.S.
T.A.S. 2018년 7월 12일
How do i get it to play multiple frames from the video? its just displaying one for now.
OCDER
OCDER 2018년 7월 12일
You might need to add a drawnow or pause(0.01) after the imshow to be able to see the video. Not sure how to set the frame rate, as that requires a different function called implay, which doesn't seem to be able to control a UIAxes.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2018년 7월 11일

댓글:

2018년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by