Transferred from http://code.opencv.org/issues/4231
|| Ehsan Azar on 2015-03-07 16:50
|| Priority: Normal
|| Affected: 2.4.9 (latest release)
|| Category: python bindings
|| Tracker: Bug
|| Difficulty:
|| PR:
|| Platform: Any / Any
[Here](http://docs.opencv.org/trunk/doc/py_tutorials/py_gui/py_video_display/py_video_display.html#saving-a-video) this line:
fourcc = cv2.VideoWriter_fourcc(*'XVID')
should be changed to this line:
fourcc = cv2.cv.FOURCC(*'XVID')
change @fourcc = cv2.VideoWriter_fourcc(*'XVID')@ to @fourcc = cv2.cv.FOURCC(*'XVID')@
- Category set to python bindings
I think you are wrong and it should not be changed. When I use OpenCV 3.0 from homebrew on OSX, and use fourcc = cv2.cv.FOURCC('m', 'p', '4', 'v')
as you suggest, it complains:
Traceback (most recent call last):
File "./video.py", line 20, in <module>
fourcc = cv2.cv.FOURCC('m', 'p', '4', 'v')
AttributeError: 'module' object has no attribute 'cv'
Cleaned up camera.
But if I leave it fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
, then it works.
The documentation link referred to trunk (OpenCV 3.0) documentation, but cv2.cv
module is used only in OpenCV 2.4.
select timeout error