Opencv error on python

最后都变了- 提交于 2019-11-30 08:50:50

问题


no matter what "CV_FOURCC" I use I get this:

OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open, file /usr/src/packages/BUILD/OpenCV-2.2.0/modules/highgui/src/cap_gstreamer.cpp, line 489

writer = cv.CreateVideoWriter(
         filename=file,
         fourcc=cv.CV_FOURCC('F', 'M', 'P', '4') ,
         fps=iFps,
         frame_size=(800,600),
         is_color=1)
cv.WriteFrame(writer, cv.LoadImage(frames[i]))

Also /usr/src/packages/BUILD/OpenCV-2.2.0/modules/highgui/src/cap_gstreamer.cpp, does not exist.

Also CV_FOURCC('H','F','Y','U') makes empty file.

Input is *.png, output is *.avi

Details: Opensuse 10.4, OpenCv 2.2.0

EDIT: If I do this this it creates a working AVI file:

writer = cv.CreateVideoWriter(
         filename=file,
         fourcc=cv.CV_FOURCC('F', 'M', 'P', '4') ,
         fps=iFps,
         frame_size=(800,600),
         is_color=1)
cv.WriteFrame(writer, cv.LoadImage(frames[i]))
del writer # this makes a working AVI

回答1:


If I do this this it creates a working AVI file:

writer = cv.CreateVideoWriter(
         filename=file,
         fourcc=cv.CV_FOURCC('F', 'M', 'P', '4') ,
         fps=iFps,
         frame_size=(800,600),
         is_color=1)
cv.WriteFrame(writer, cv.LoadImage(frames[i]))
del writer # this makes a working AVI


来源:https://stackoverflow.com/questions/6918995/opencv-error-on-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!