一尘不染

Python上的OpenCV错误

linux

无论我使用什么 “ CV_FOURCC”, 我都会得到:

OpenCV错误:CvVideoWriter_GStreamer :: open中不支持的格式或格式组合(Gstreamer
Opencv后端不完全支持此编解码器。),文件/usr/src/packages/BUILD/OpenCV-2.2.0/modules/highgui/src/
cap_gstreamer.cpp,第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

阅读 353

收藏
2020-06-07

共1个答案

一尘不染

如果我这样做,它将创建一个有效的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
2020-06-07