I am trying to save a video as .avi
format but i keep getting the error \"could not demultiplex stream\"
. I primarily want to save grayscale videos
There are 3 things to keep in mind when you are trying to write Grayscale image in video writer. 1. while reading the image,keep 0 followed by ','
image = cv2.imread("data/PCB.jpg",0)
2&3. While creating the video writer, declare shape in opposite way and keep 0 followed by ',' as we did in step 1
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc, 20.0, (image.shape[1],image.shape[0]),0)