GUI Matlab Video Processing

조회 수: 3 (최근 30일)
Sevthia Nugraha
Sevthia Nugraha 2018년 6월 23일
댓글: Sevthia Nugraha 2018년 7월 15일
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?

답변 (2개)

Walter Roberson
Walter Roberson 2018년 6월 23일

Sevthia Nugraha
Sevthia Nugraha 2018년 7월 15일
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
Sevthia Nugraha
Sevthia Nugraha 2018년 7월 15일
and i realized that code is yours, thanks

댓글을 달려면 로그인하십시오.

카테고리

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