Opencv: document for video writing (Python) not using FOURCC

Created on 27 Jul 2015  路  3Comments  路  Source: opencv/opencv

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

document for video writing (Python) not using FOURCC

[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')

History

Ehsan Azar on 2015-03-07 16:52
change @fourcc = cv2.VideoWriter_fourcc(*'XVID')@ to @fourcc = cv2.cv.FOURCC(*'XVID')@
Vadim Pisarevsky on 2015-04-27 11:33
-   Category set to python bindings
2.4 auto-transferred bug python bindings invalid normal

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings