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 Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by