control of play video
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!