how to play videos using implay function in specific axes?

조회 수: 6 (최근 30일)
Vignesh
Vignesh 2015년 5월 8일
댓글: souilah ridha 2020년 3월 19일
i am trying to play videos in my matlab gui but i couldnt figure out how to play video in my specific axes. plz help me :)
  댓글 수: 2
Nguyen Duc Phu
Nguyen Duc Phu 2016년 7월 5일
편집: Walter Roberson 2017년 5월 29일
global videoFReader
faceDetector = vision.CascadeObjectDetector();
videoFReader = vision.VideoFileReader('test.avi');
videoPlayer = vision.VideoPlayer;
while ~isDone(videoFReader)
videoFrame = step(videoFReader);
step(videoPlayer, videoFrame);
end
axes(handles.axes1)
imshow(videoFReader);
% However Videoplayer is not in axes box !!!!
Please help me
Ghanashyama Prabhu
Ghanashyama Prabhu 2017년 10월 25일
global show_video; videoFReader = vision.VideoFileReader('test.mp4'); framert = 30; videoPlayer = vision.VideoPlayer; ax = handles.axes1; % assuming axes1 is used to disply in GUI while ~isDone(videoFReader) videoFrame = step(videoFReader); image(videoFrame, 'Parent', ax); set(ax,'Visible', 'off'); pause(1/framert); if show_video ~=1 % used as global so that can be set at controlling place. if show_video = 1 continuously play break end end release(videoPlayer);

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

채택된 답변

Thomas Koelen
Thomas Koelen 2015년 5월 8일
편집: Thomas Koelen 2015년 5월 8일
You have axes in your gui, let's say they are called
axes1
(you can check the name of the axes by double clicking on it in GUIDE, then look for Tag.
Then the only thing you have to do is:
axes(handles.axes1);
implay(videohere);
  댓글 수: 7
Jaroslava Orenicova
Jaroslava Orenicova 2017년 10월 19일
Hi, Ive just tried both ways but it doesnt work. Implay always pop new window, I need to have it in the axes in GUI.
souilah ridha
souilah ridha 2020년 3월 19일
how can i use it with 'implay'

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

추가 답변 (2개)

Gabriel Zalles
Gabriel Zalles 2017년 6월 26일
Can I just say? Matlab support is attrocious. I can't believe how little help there is online for problems like this. The company should pay people to go online and provide solutions for people.

Ganesh Raut
Ganesh Raut 2015년 5월 8일
Thomas Koelen..
ur answer not work.. actually play video but not in axes..plz help
  댓글 수: 4
Matt J
Matt J 2017년 8월 25일
Check the my comment, this should work.
No, it doesn't work. It will play in the designated axes, but the use of a for-loop in conjunction with pause gives a very inaccurate frame rate.
Ghanashyama Prabhu
Ghanashyama Prabhu 2017년 10월 25일
global show_video; videoFReader = vision.VideoFileReader('test.mp4'); framert = 30; videoPlayer = vision.VideoPlayer; ax = handles.axes1; % assuming axes1 is used to disply in GUI while ~isDone(videoFReader) videoFrame = step(videoFReader); image(videoFrame, 'Parent', ax); set(ax,'Visible', 'off'); pause(1/framert); if show_video ~=1 % used as global so that can be set at controlling place. if show_video = 1 continuously play break end end release(videoPlayer);

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by