5

I want to produce a video file out of a stream of RGB images flowing at 52fps. I found the opencv api pretty handy to use (cv::VideoWriter). The problem is that I can play the produced avi only with VLC; which plays the video but yells:

[0x28307b0] xcb_xv generic error: no available XVideo adaptor

Any other video player (on the same computer) is not able to read and play the video. While recording everything looks ok: I get information about the output, about the size of the frame, the video codec, the fps, etc...no error.

Output #0, avi, to '01-23-12_15-24-51.avi':
Stream #0.0: Video: flv, yuv420p, 500x242, q=2-31, 7744 kb/s, 90k tbn, 52tbc 

As OpenCv only supports avi as video container, the only thing I could change is the video codec, I tried (FOURCC code) FLV1, DIVX, DIV3 but none of them works correctly.

I would like to play this video with any video player on different computers. How can I make it work? is VideoWriter the right choice?

Any suggestion is very welcome.

Thanks.

sciarp
  • 314
  • 3
  • 14
  • At 52 fps you might be pushing the limits of what OpenCV can do. I would try with 30 fps first and see how the other video players respond to this. – karlphillip Jan 24 '12 at 00:12
  • OpenCV relies on FFmpeg to do all the low-level-video-related stuff; I'm pretty sure ffmpeg can go beyond 52 fps. Anyway, thanks for the suggestion I tried but it doesn't work. – sciarp Jan 24 '12 at 01:00
  • try a different codec (FOURCC) when creating the video file. Choose a simple one, an MPEG2, or something like that – Sam Jan 24 '12 at 10:00

1 Answers1

1

If you have a video source for your images, it would be a good idea to use the same codec for output:

int videoType = (int)cap.get(CV_CAP_PROP_FORMAT);

VideoWriter vout;
vout.open(videofile + "_out.avi", videoType, 30, imgSize);

Or, you can try an older, simpler FOURCC. Or a Microsoft-specific, if you want to run it only on Windows.

Sam
  • 19,708
  • 4
  • 59
  • 82