Play Video in MATLAB GUI with other Objects
古いコメントを表示
Hi, all. I'm starting an experiment where I need to have a video window, as well as a number of text boxes and buttons in a single GUI window. Is this possible? Does anyone have any example code or suggestions on how I might be able to embed the video into the GUI and control it?
Thank you kindly.
Bill
採用された回答
その他の回答 (3 件)
Chaowei Chen
2011 年 8 月 27 日
function main
vid = videoinput('winvideo', 1);
figure;
h_play=uicontrol('style','pushbutton','callback',@play_vid,'string','play','position',[200 20 80 20]);
h_stop=uicontrol('style','pushbutton','callback',@stop_vid,'string','stop','position',[300 20 80 20]);
h_img=image;
%%
function play_vid(hObject,events), preview(vid,h_img), end
function stop_vid(hObject,events), stoppreview(vid), end
end
3 件のコメント
Chaowei Chen
2011 年 8 月 27 日
This unpolished code may do your work if you plug a USB webcam.
Also, http://www.mathworks.com/help/toolbox/imaq/f11-74309.html
may help.
Bill
2011 年 8 月 27 日
Bill
2011 年 8 月 27 日
Chaowei Chen
2011 年 8 月 27 日
function main
[f,p]=uigetfile('*.avi');cd(p)
h_play=uicontrol('style','pushbutton','callback',@play_vid,'string','play','position',[200 20 80 20]);
function play_vid(hObject,events), winopen(f); end
end
1 件のコメント
Chaowei Chen
2011 年 8 月 27 日
This won't put the video window in the GUI. Maybe somebody can help.
Sk Sahariyaz Zaman
2016 年 4 月 28 日
0 投票
カテゴリ
ヘルプ センター および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!