python上的Opencv错误

无论我使用什么“CV_FOURCC”我得到这个:

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]))

另外/usr/src/packages/BUILD/OpenCV-2.2.0/modules/highgui/src/cap_gstreamer.cpp也不存在.

CV_FOURCC(‘H’,’F’,’Y’,’U’)也会生成空文件.

输入为* .png,输出为* .avi

详细信息:Opensuse 10.4,OpenCv 2.2.0

编辑:如果我这样做,它会创建一个工作的AVI文件:

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

解决方法:

如果我这样做,它会创建一个工作的AVI文件:

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
上一篇:Django 启动报错 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7


下一篇:Qt4.8版本中文乱码