I am using this function (inside a class) to save an array of images into a video. Despite the program running with no errors, the video I got, in the end, is not what was expected. It has a stripy effect even though when I print the images individually everything is ok.
def saveVideo(self):
import cv2
out = cv2.VideoWriter("output.mp4", cv2.VideoWriter_fourcc(*'mp4v'), self.fps, (160, 122), 0)
for i in range(0, len(self.images)):
out.write(self.images[i])
out.release()
Update: What happens is that the image in the video looks like the original image stretched, flipped, and with the black bars in the middle. There must be a problem with the video shape but I cannot manage to solve it.