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
It is possible that .DIVX
is looking for a 3-channel BGR image to write, but you're only providing it a single channel image, since you're trying to write a grayscale image
Try doing this:
frame = cv2.cvtColor(frame, cv2.COLOR_GRAY2BGR)
essentially this will try to convert your greyscale image to BGR image. While your pixel values will remain gray, this will change frame
to a 3-channel image