control of play video

조회 수: 3 (최근 30일)
Pan
Pan 2012년 8월 5일
Hi, currently ,I have one code.
function f1()
clear all;
load totalbook xi idxip
obj1 = mmreader('keybook.avi');
vid1 = read(obj1);
frame1 = 1;
f4 = 1;
hst1=0;
h = figure('Name','Video ', 'NumberTitle','off','Color',[1,1,1],'Toolbar','none','Visible','on', 'Position',[10 40 1350 700],...
'Resize','on','menu','none');
hstat1 = uicontrol('unit','pixel','style','checkbox','value',0,'position',...
[50 420 25 25],'units','normalized');
hplay1 = uicontrol('unit','pixel','style','pushbutton','string','書本_PLAY',...
'position',[50 420 70 40],'backgroundColor',[0.3,0.7,1],'units','normalized','callback',{@play1_callback});
hstop1 = uicontrol('unit','pixel','style','pushbutton','string','書本_STOP',...
'position',[50 320 70 40],'backgroundColor',[0.2,1,0],'units','normalized','callback',{@stop1_callback});
hori1 = uicontrol('unit','pixel','style','pushbutton','string','書本_ORI',...
'position',[50 220 70 40],'backgroundColor',[1,1,0.3],'units','normalized','callback',{@ori1_callback});
hexit = uicontrol('unit','pixel','style','pushbutton','string','EXIT',...
'position',[50 120 70 40],'backgroundColor',[1,0,0],'units','normalized','callback',{@exit_callback});
while (1)
if hst1==1
subplot(1,1,1);
imshow(vid1(:,:,:,frame1));
title('keyframe video');
if frame1 < size(vid1,4)
pause(1);
frame1 = frame1+1;
else
pause(1);
frame1 =1;
end
end
drawnow;
if f4 ==15
break;
% else f4 = f4+1;
end
end
function play1_callback(hObject0,eventdata0)
set(hstat1,'value',1);
hst1=1;
set(hplay1 ,'backgroundColor',[1,1,0],'string','書本_播放中');
end
function stop1_callback(hObject,eventdata)
set(hstat1,'value',0);
hst1=0;
set(hplay1 ,'backgroundColor',[0.3,0.7,1],'string','書本_PLAY');
frame1
end
function ori1_callback(hObject,eventdata)
set(hstat1,'value',0);
hst1=0;
set(hori1 ,'backgroundColor',[0,0.3,0.9],'callback','bookindexl');
bookindexl(frame1);
end
function exit_callback(hObject,eventdata)
f4=15;
stop1_callback;
close gcf;
end
end
this is play video, but now I must play other video that is produce other code have play same figure. How to I do ,pleas teach me ,thank you!!

답변 (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