QStreamer is a Qt class that captures images from a webcam. It requires Linux and xawtv's streamer program.
QStreamer provides a very simple webcam-capture API. It is integrated into the Qt framework, and emits a signal whenever a new image is available. QStreamer uses xawtv's streamer program to retrieve webcam images, which is only available under Linux. The streamer program normally outputs the images to hard drive, but QStreamer re-directs them to RAM. Streamer is started as a separate process, and is terminated by stopStream, or when QStreamer is deleted.
QStreamer, a camera-capture library version 1.0.0, Feb 6, 2010
Copyright (C) 2010 David C. McCallum
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
David McCallum email@example.com
QStreamer only works with Qt programs, and was tested with Qt version 4.5.2. QStreamer requires the streamer program from xawtv. Under Ubuntu, streamer can be installed with:
sudo apt-get install streamer
Copy QStreamer.hpp and QStreamer.cpp into your source directory, and add #include "QStreamer.hpp" to your program. You should then be able to compile as normal with qmake.
The QStreamer constructor.
Start getting images from the specified device. Stops the existing stream if startStream was previously called.
Returns false if an error occurred, and sets errMsg appropriately.
Stop getting images and terminate the streamer program. Returns false if we couldn't stop streamer, and sets errMsg. If streamer couldn't be stopped, it's generally because the streamer program had already stopped running.
The streamer program is normally set to write images to the system's ramdrive, /dev/shm. Use setRamdriveDir to tell streamer to write to a different directory. Takes effect the next time startStream is called.
Returns a description of the most recent error.
Emitted when we get a new image from the camera.