필터 지우기
필터 지우기

How can I get any pressed key while playing the video?

조회 수: 1 (최근 30일)
MOHIT
MOHIT 2016년 5월 16일
댓글: MOHIT 2016년 5월 22일
I want to get any pressed key during the video is played, using 'KeyPressFcn'
my script is
videoFReader = vision.VideoFileReader('rhinos.avi');
videoPlayer = vision.VideoPlayer;
% Play video. Every call to the step method reads another frame.
while ~isDone(videoFReader)
frame = step(videoFReader);
step(videoPlayer,frame);
% pause(1)
end
% Close the file reader and video player.
release(videoFReader);
release(videoPlayer);

채택된 답변

Walter Roberson
Walter Roberson 2016년 5월 22일
VideoPlayer opens its own play interface and there is no way to tell it to play within a specific axes or figure. That makes it more difficult to find the figure and attach a callback to it. Easier is to create another figure and attach a WindowKeypressFcn callback to it and give the figure focus (so that it becomes the one that receives the keypress events.)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by