Ask Your Question

rpcarn's profile - activity

2016-03-21 14:10:04 -0600 commented answer How to record video using OpenCV and Python?

I could only get VideoWriter to work by using the same frame as my video capture and using this codec: mp4v (lowercase):

cap = cv2.VideoCapture(0)
w = cap.get(cv2.CAP_PROP_FRAME_WIDTH);
h = cap.get(cv2.CAP_PROP_FRAME_HEIGHT); 
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter('output.mp4',fourcc, 15.0, (int(w),int(h)))

Mac OS X El Capitan 10.11.3 with Python 2.7.11, OpenCV 3.1.0

2016-03-21 13:56:16 -0600 received badge  Supporter (source)