Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

linux - Opencv error on python

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...