There is a 2D for height and width of the video, which shows the resolution, the 3rd D is for example is of size 3 for RGB or of size 1 for grayscale.
This 3 dimensions would describe one image. Since you have a video, there are all those single frames in the 4th dimension one after eachother.
What you want i guess is readFrame since you use a for loop. What you did is reading the whole video into one 4D array. This would not need a loop.
Best Answer