Basically I want to convert a .mts movie file to a numpy array. Each frame of the movie is 1080x1920 and the file is 47.1 MB in size for 721 frames. What I want is to convert this to a numpy array of size (721,1080,1920,3). For some reason my attempt to do so is giving the error
Below is my code:
Error:Traceback (most recent call last):
File "<pyshell>", line 13, in <module> cv2.error:
OpenCV(3.4.4) C:\projects\opencv-python\opencv\modules\core\src\alloc.cpp:
55: error: (-4:Insufficient memory) Failed to allocate 6220800 bytes in function 'cv::OutOfMemoryError'I'm not sure why this is happening as I am using a computer with 63.9 GB of usable RAM with no other programs open in Windows 10 using the Thonny IDE. Why is this happening, and how do I fix this? Below is my code:
import cv2
import numpy as np
vidcap=cv2.VideoCapture('C:\\Users\\John\\Desktop\\delete\\00001.mts')
success, image=vidcap.read()
g=[]
g.append(image)
length=int(vidcap.get(cv2.CAP_PROP_FRAME_COUNT))
count=2
while success:
if count<length:
vidcap.set(cv2.CAP_PROP_POS_FRAMES,count)
sucess, image =vidcap.read()
count=count+1
g.append(image)
else:
success=False
R=np.asarray(g)
