Creating a video using OpenCV 2.4.0 in python

后端 未结 3 1129
悲哀的现实
悲哀的现实 2020-12-05 20:27

I am trying to create a video using OpenCV 2.4.0 in python 2.7.2. But the avi file size is 0.

My code:

from cv         


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 20:47

    height, width, layers = img.shape
    out = cv2.VideoWriter("output.avi", cv2.VideoWriter_fourcc(*"XVID"), 30,(width,height))
    out.write(img)
    out.release()
    

提交回复
热议问题