I have tried to save a list of arrays to a video using the following code, but it isn't working.
out = cv2.VideoWriter("output.mp4", cv2.VideoWriter_fourcc(*'mp4v'), 30, (1280, 720))
for frame in frames:
out.write(frame) # frame is a numpy.ndarray with shape (1280, 720, 3)
out.release()
It fails with no error message, but the output file (output.mp4) is around 200 bytes long and doesn't open in QuickTime or VLC. My assumption is that out.write is somehow failing silently. Is it possible to write arrays to a video in this way? If not, how could it be done?
Any and all help is very much appreciated.
out = cv2.VideoWriter("output.mp4", cv2.VideoWriter_fourcc(*'mp4v'), 30, (720, 1080))