views:

195

answers:

2

Hi all,

Very soon we are going to work on a project with open source s/w that does many things and one of the modules concerns with capturing live feed from a usb based camera for upto 48 hours and overwriting it in a nonstop loop. This would be going on in parallel with other operations in the application. We also have to display the captured feed of the least 48 hours to the user as a menu option.

I would like you all to suggest a suitable open source technology stack taking into account the audio/video part of the module, without this feature I can definitely use Qt to do my stuff but with this feature that becomes a difficult proposition. I have developed GUI applications with Qt on Linux platform but haven't been able to come up with something that can record and display video in an application. Qt has phonon but setting it up is a nightmare. Earlier some of you had suggest v4linux. I tried to compile the sample program capture.c on RHEL 4 machine and it gave the following errors.

usr/src/kernels/2.6.9-5.EL-i686/include/linux/videodev2.h:436: warning: no semicolon at end of struct or union

/usr/src/kernels/2.6.9-5.EL-i686/include/linux/videodev2.h:436: error: syntax error before '*' token

/usr/src/kernels/2.6.9-5.EL-i686/include/linux/videodev2.h:438: error: syntax error before '*' token

/usr/src/kernels/2.6.9-5.EL-i686/include/linux/videodev2.h:438: warning: data definition has no type or storage class

/usr/src/kernels/2.6.9-5.EL-i686/include/linux/videodev2.h:439: error: syntax error before '}' token

/usr/src/kernels/2.6.9-5.EL-i686/include/linux/videodev2.h:810: error: field `win' has incomplete type

So hit a dead end, besides I haven't come up with concrete workable examples for the same. Also the website isn't being updated frequently suggesting a stagnancy in development process.

Since the application will be graphical with menu based user interaction, it would need to use Qt or something similar to it for the graphical part. The headache is I haven't been able to figure out, how I can implement/integrate the video capture/display feature in a dummy application (my try was with Qt may be some of you have done it with some other library or language).

EDIT: Was able to compile the program by importing a local copy of videodev2.h and adding define statement to include a __user macro. But now it won't run as it cannot find /dev/video device. So again stuck at a dead end in video4linux

A: 

You could try the FFmpeg family of libraries. As of fairly recently (I think), it also comes with the libavdevice library that supports V4L and V4L2 for video capture, and it shouldn't be very difficult to build a FFmpeg pipeline to read video from an avdevice source and write it using avcodec and avformat into a file...

AKX
A: 

gstreamer is a very capable multimedia stack for capturing, and pygst and PyQt4 bindings exist for use in Python.

Ignacio Vazquez-Abrams