How do i play a movie in a GUI axes?

2 views (last 30 days)
Franchesca
Franchesca on 13 May 2014
Edited: Matt J on 25 Aug 2017
i have imported an .avi file into the GUI however am unable to make it play.
This is the code I have at the moment:
% --- Outputs from this function are returned to the command line.
function varargout = GUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
A = imread ('track.jpg');
axes(handles.axes3);
imshow(A);
% --- Executes on button press in pushbutton6.import video
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[nm,pth]=uigetfile({'*.avi'},'Load Matlab File');
mmObj=mmreader([pth,nm]);
handles.pth=pth;
handles.nm=nm;
handles.Video=mmObj;
image1=read(mmObj,1);
axes(handles.axes1);
imshow(image1);
guidata(hObject,handles);
% --- Executes on button press in pushbutton5. select finish line
function pushbutton5_Callback(hObject, eventdata, handles)
%[nm,pth]=uigetfile({'
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%figure(5)
%imshow();%show image finish line
[x,y]=ginput(1)
%x=data(1){:,1}
%y=data(1){:,2}
% --- Executes on button press in pushbutton1. finish frame
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
fline(:,a:b)=image1(:,st:st+w);
imagesc(fline.^0.5);
colormap('gray')
% --- Executes on button press in pushbutton3.print frame
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton7. Play/pause
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
movie(handles.axes2, mov01);
the movie(m) doesn't seem to be working to play the movie in the GUI, how would i do this?

Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!