GUI Matlab Video Processing

3 visualizaciones (últimos 30 días)
Sevthia Nugraha
Sevthia Nugraha el 23 de Jun. de 2018
Comentada: Sevthia Nugraha el 15 de Jul. de 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?

Respuestas (2)

Walter Roberson
Walter Roberson el 23 de Jun. de 2018

Sevthia Nugraha
Sevthia Nugraha el 15 de Jul. de 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
  1 comentario
Sevthia Nugraha
Sevthia Nugraha el 15 de Jul. de 2018
and i realized that code is yours, thanks

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by