i have the following code to make 2 videos side by side.
v1 = VideoReader('XXXXXXX.avi')v2 = VideoReader('XXXXXXX.avi')i1 = 0;i2 = 0;while i1 < v1.NumberOfFrames && i2 < v2.NumberOfFrames if i1 < v1.NumberOfFrames i1 = i1+1; subplot(2,2,1) image(v1.read(i1)) end if i2 < v2.NumberOfFrames i2 = i2+1; subplot(2,2,2) image(v2.read(i2)) end drawnow end
but a figure will keep popping out whenever i try to close the window. the window will only close until the video ends. how to fix that? i will also get an error saying :
Error using VideoReader/read (line 160)The frame index requested is beyond the end of the file.
how to fix both things? please help.
Best Answer