Display 2 different video in same GUI
显示 更早的评论
I am doing a GUI to display 2 video. First video is recorded video, second is the image sequence and need to display at 25 fps. The problem now is i am unable to play 2 video at the same time, just the 1st video played when the button is press. I need to play the 2 video when a button is press. Below is the error after i close the GUI window. Hope someone can help to check where is the error. Thanks.
Error using hgsetdisp (line 8)
Invalid or deleted object.
Error in guitest>pushbutton1_Callback (line 101)
set(hf2)
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in guitest (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)guitest('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating DestroyedObject Callback
Below is My Coding:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Obj = VideoReader('ken-test2_mpeg4.mp4');
vidFrames = read(Obj);
vidFrames=imrotate(vidFrames,-90);
numFrames = get(Obj, 'numberOfFrames');
for k = 1 : numFrames
mov(k).cdata = vidFrames(:,:,:,k);
mov(k).colormap = [];
end
hf = handles.axes1;
set(hf)
movie(hf, mov, 1, Obj.FrameRate);
Output=evalin('base','imgsequence');
[~,~,~,numFrames2]=size(Output);
for l = 1 : numFrames2
mov2(l).cdata = Output(:,:,:,l);
mov2(l).colormap = [];
end
hf2 = handles.axes2;
set(hf2)
movie(hf2, mov2, 1, 25);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!