I'm trying to read a 25 second long video file in Matlab and trying to process it in parallel using parfor. I'm trying to split it into 5 shorter videos, each of 5 seconds length. Here is the code for that:-
mov = VideoReader('movie.avi');
parfor i=1:5
vd(i)=read(mov,[(i-1)*5+1, (i)*5]);
current_frame=0;
while hasFrame(vd(i))
current_frame=current_frame+1;
vidFrame = readFrame(vd(i));
fprintf('%d part, frame no %d\n',i,current_frame);
end
end
I keep getting this error on the first line inside parfor loop.
Subscripted assignment dimension mismatch
How do I retrieve what is coming from read function into the frame variable vd?