Nov-07-2019, 01:31 AM
I have a movie, .mts file, that I want to be able to read into a numpy array that is (w,h,3,f), where w is the frame's width, h its height, and f the number of frames in the movie. 3 refers to the RGB value. Below is my program for doing it. My problem though is that when I run it that it consumes all of the memory on my computer and everything freezes up. I don't understand why since the movie is only 26 MB and I have 3.7GB of RAM memory . I am using Spyder and when not running it says memory is 36% in the lower right hand corner and then jumps up to 96% memory when the program is running and freezes. Why is this happening and how do I fix this? Is there a better way to write this?
1 2 3 4 5 6 7 8 9 10 11 |
import cv2 cap2 = cv2.VideoCapture( '//home//jr//Desktop//Movie1.MTS' ) movieA = [] while (cap2.isOpened()): status, frame = cap2.read() if status = = True : movieA.append(frame) else : break cap2.release() |