2

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
6
  • 1
    looks like a setup issue. do the tests (<cmake_binary_dir>/bin[/debug|/release]/cxcoretest and cvtest) work? Commented Aug 2, 2011 at 22:00
  • @mitch_feaster I didn't compile it, I installed it with YaST2 Commented Aug 2, 2011 at 22:05
  • Have you tried the raw format CV_FOURCC('M', 'J', 'P', 'G') ? Commented Aug 3, 2011 at 1:40
  • @karlphillip Yes, it failed to work Commented Aug 3, 2011 at 16:19
  • possible duplicate of Unable to create a basic video file using OpenCV Commented Aug 3, 2011 at 16:53

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

3 Comments

@karlphillip But if I do cvReleaseVideoWriter(writer) or cv.ReleaseVideoWriter(writer) it says "no attribute "ReleaseVideoWriter" in module.."
It's there. From your code I can't tell how you are including OpenCV but usually I do from opencv.cv import * and from opencv.highgui import *
I think you are both right, opencv.cv was a previous build of the current one, while cv is the latest. I also cant find cvReleaseVideoWriter in opencv2.3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.