Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you're trying to write a grayscale image, while your current setup expects a color one. so try:

out = cv2.VideoWriter('output1.mp4', fourcc , 20.0, (640,480), False)

more things to check:

  • make sure, opencv_ffmpeg320.dll is on your PATH, or accessible to cv2.pyd at runtime
  • first try with MJPG and .avi , then experiment with other codecs/containers.
  • make sure, the size you give to the VideoWriter is the actual size of the image you write later
  • check return values from out.read() and cap.isOpened()

you're trying to write a grayscale image, while your current setup expects a color one. so try:

out = cv2.VideoWriter('output1.mp4', fourcc , 20.0, (640,480), False)

more things to check:

  • make sure, opencv_ffmpeg320.dll is on your PATH, or accessible to cv2.pyd at runtime
  • first try with MJPG and .avi , then experiment with other codecs/containers.
  • make sure, the size you give to the VideoWriter is the actual size of the image you write later
  • check return values from out.read() and cap.isOpened()out.isOpened()