フィルターのクリア

How coding to read avi files, take every frame and save it back in the variable mov1 on a GUI?

1 回表示 (過去 30 日間)
readerobj = mmreader('AC (1).avi','tag','myreader1')
vidFrames = read (readerobj);
numFrames = get (readerobj, 'numberOfFrames');
h = waitbar(0,'Tunggu sebentar sedang proses...');
for k = j : numFrames
waitbar (k/numFrames,h)
f = vidFrames(:,:,:,k);
mov1(k).cdata = f;
mov1(k).colormap = [];
end
waitbar(1,h)
hf1 = figure (1);
set(hf1);

採用された回答

Geoff Hayes
Geoff Hayes 2016 年 3 月 5 日
Marquel -please describe how the above code is used within with respect to your GUI. Do you have a push button that loads the media from the avi file? Have you used GUIDE to create your GUI? If so, then just save mov1 to the handles structure of the callback that launched the above
% function to load the AVI media
function pushbutton1_Callback(hObject, eventdata, handles)
readerobj = mmreader('AC (1).avi','tag','myreader1')
vidFrames = read (readerobj);
numFrames = get (readerobj, 'numberOfFrames');
h = waitbar(0,'Tunggu sebentar sedang proses...');
for k = j : numFrames
waitbar (k/numFrames,h)
f = vidFrames(:,:,:,k);
mov1(k).cdata = f;
mov1(k).colormap = [];
end
waitbar(1,h);
% save the mov1 variable to handles
handles.mov1 = mov1;
guidata(hObject,handles);
We use guidata to store the media to the handles structure so that all other callbacks or functions from within your GUI have access to it.

その他の回答 (0 件)

カテゴリ

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