Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solution (i am not waiting 2 days to answer my own question).

import cv2
import numpy as np
x = np.random.randint(0,255,(100,100,3)).astype('uint8')
writer = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc('M','J','P','G'), 25, (100,100), True)
for k in range(100):
  writer.write(x)
writer.release()

Solution (i am not waiting 2 days to answer my own question).

import cv2
import numpy as np
x = np.random.randint(0,255,(100,100,3)).astype('uint8')
writer = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc('M','J','P','G'), 25, (100,100), True)
for k in range(100):
  writer.write(x)
writer.release()

EDIT 1:

I just changed video form to MJPG and it worked. I still have no idea why PIM1 doesnt work. It works on my other computer just fine.