GUI Matlab Video Processing

3 visualizzazioni (ultimi 30 giorni)
Sevthia Nugraha
Sevthia Nugraha il 23 Giu 2018
Commentato: Sevthia Nugraha il 15 Lug 2018
I got a problem in my final project. if we read frames in matlab gui 2015a, can we hear the audia too? i still can't hear the audio even my coding goes well. maybe, anyone knows?

Risposte (2)

Walter Roberson
Walter Roberson il 23 Giu 2018

Sevthia Nugraha
Sevthia Nugraha il 15 Lug 2018
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)
[chosenfile, chosenpath] = uigetfile('*.mp4', 'Select a video');
if ~ischar(chosenfile)
return; %user canceled dialog
end
filename = fullfile(chosenpath, chosenfile);
set(handles.edit50, 'String', filename);
% --- Executes on button press in Start Button.
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)
filename = get(handles.edit50, 'String');
if ~exist(filename, 'file')
warndlg( 'Text in edit box is not the name of a file');
return
end
try
obj = VideoReader(filename);
catch
warndlg( 'File named in edit box does not appear to be a usable movie file');
return
end
axes1 = handles.axes1;
obj = VideoReader(filename);
while hasFrame(obj)
vidFrame = readFrame(obj);
image(vidFrame, 'Parent', axes1);
set(axes1, 'Visible', 'off');
pause(1/obj.FrameRate);
end
clear obj
i'm sorry that i can't open that website, so that's my code. and i still facing the problem with the sound. How can i get the sound of my file, Sir? Thank you

Community Treasure Hunt

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

Start Hunting!

Translated by