import numpy as np
import cv2
cap = cv2.VideoCapture('sample_video.mp4')
if cap.isOpened() == False:
print('Error opening videofile')
list_frame = []
while cap.isOpened():
ret, frame = cap.read()
list_frame .append(frame) # list of frame cannot store many frames (like 1000+)
I tried using mmap() function for memory mapped support, but mmap takes a very long time to access frames that are stored in the mmap object
import cv2
cap = cv2.VideoCapture('sample_video.mp4')
if cap.isOpened() == False:
print('Error opening videofile')
list_frame = []
while cap.isOpened():
ret, frame = cap.read()
list_frame .append(frame) # list of frame cannot store many frames (like 1000+)
I tried using mmap() function for memory mapped support, but mmap takes a very long time to access frames that are stored in the mmap object