how to play videos using implay function in specific axes?
Mostra commenti meno recenti
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 Commenti
Nguyen Duc Phu
il 5 Lug 2016
Modificato: Walter Roberson
il 29 Mag 2017
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
il 25 Ott 2017
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);
Risposta accettata
Più risposte (2)
Gabriel Zalles
il 26 Giu 2017
5 voti
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
il 8 Mag 2015
1 voto
Thomas Koelen..
ur answer not work.. actually play video but not in axes..plz help
4 Commenti
Thomas Koelen
il 8 Mag 2015
Modificato: Thomas Koelen
il 8 Mag 2015
MOHIT
il 19 Mag 2016
but you have not used 'implay'
Matt J
il 25 Ago 2017
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
il 25 Ott 2017
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);
Categorie
Scopri di più su Video Formats and Interfaces in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!