I am trying to read several .mp4 videos from a .zip folder for further processing. Trying to used zipfile and OpenCV like this:
zf = ZipFile(video_zip_loc)
all_files = zf.namelist()
video_file = zf.read(all_files[0])
cap = cv2.VideoCapture(video_file)
But get the following error
TypeError: an integer is required (got type bytes)
Also attempted to use
np.frombuffer(video_file, np.uint8)
As suggested here: Using python opencv to load image from zip. This returns a 1D array and I am not sure how to convert it into a sequence of images. If I try sticking it into VideoCapture get the following error:
TypeError: only size-1 arrays can be converted to Python scalars
Is there a solution to this? Or should I just unzip all the videos first? (Several GB of data...)