videoInput- a free windows video capture library Why it rocks.... 1) Needs no additonal software installed. 2) No pop up windows to select settings. Specify it in code. 3) Can capture from multiple capture devices at the same time. 4) Supports wide number of video capture devices. 5) It is fast. 6) It is free. DISCLAIMER - This software is experimental, use at your own risk. It is released free of charge under no license, feel free to send me fixes, improvements etc - email is in the header file. |
Update: from now on all development will be done on my Github videoInput repo. Please follow the project there, file requests, send patches etc... |
Latest Release: New - videoInput0.1995 lib and src Version 0.1995 - Jan 2009 Lots of new stuff! If there are no major issues with this release it will become the 0.2 release.
New Features:
Fixes: |
Latest Release: New - videoInput0.1991 lib and src Version 0.1991 - April 2008
Fixes a bug with 0.199 which can cause a crash when trying to load a camera. This version has been in private testing and results have been very good so far. If you have usb capture devices that stop capturing after a while - see the notes included in the download on how to disable Windows power saving on your USB ports. This was found to be the cause for a lot of devices freezing after a certain amount of time.
|
Latest Release: videoInput0.199 lib and src - bug found Version 0.199 - December 2007
There have been some issues with certain capture cards freezing with previous releases. If you have downloaded 0.198 please replace with this release!
Callback method can be set before capture begins. |
Bad Release: Bad Release - videoInput0.198 lib and src Bad Release - Version 0.198 - November 2007 Don't download this release - get 0.199.
Added setFormat(), to set a default format (NTSC / PAL etc) |
Latest Release: NEW! videoInput0.195 lib and src Version 0.195 - June 2007 Minor patch to 0.194 - fixes a naming conflict between openCV (cvaux) and videoInput. Thanks to Golan Levin for the catching the openCV conflict as well as much needed spelling help :)See version 0.194 notes bellow |
Latest Release: videoInput0.194 lib and src Version 0.194 - June 2007
THIS IS A BUG FIX VERSION - NEW FEATURES COMING IN 0.200 |
Latest Release: videoInput0.191 Lean and Mean lib and src Version 0.191 - April 2007
New stuff: |
Latest Release: videoInput0.19 lib and src Version 0.19 - April 2007
New stuff: -source code -basic demo project for Visual Studio / C++ -static compiled lib for Visual Studio / C++ and project -openGL demo app for codewarrior -static compiled lib for codewarrior and project NOTE: The API has changed slightly so please read videoInput.h for correct usage!! :) VISUAL STUDIO This release has been tested with Visual Studio 2005 express - but it should work fine with the full version too! You need to have the windows SDK installed - which is pretty normal. Please read the visual studio notes! It will make life easier. To get the windows sdk working in VS 2005 express - you have to jump through these hoops! http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
DEMO APPS
Use the CW demo app to check if you camera is connecting okay.
|
Latest Release: videoInput0.171vs lib and src Version 0.171vs First release with Visual C++ demo App!!!
Includes:
This release has been tested with Visual Studio 2005 express - but it should work fine with the full version too!
To get the windows sdk working in VS 2005 express - you have to jump through these hoops!
The demo app included is a simple openGL app that creates a window and grabs video from a capture device to a texture. Read the notes for release 0.17 for class useage. Thanks to Phillip and Jared of Potion Design ( www.potiondesign.com ) for visual studio help and Dynal Patel, for remote debugging and impetus to do the whole VS thing! More soon!!
|
Latest Release: videoInput0.171 lib and src Version 0.171 Micro release! Use this version instead of previous versions. 0.18 Coming soon!!! The other versions prob aren't visual studio friendly. Thanks to Phillip and Jared of Potion Design ( www.potiondesign.com ) for figuring out some bugs that prevented proper use in Visual Studio. How to use in visual studio 2005:
1) go to Options->VC Directories->Library paths and specify
directory where videoInput.lib is
|
Latest Release: videoInput0.17 lib and src
Version 0.17
-Now supports 1394 pixelink cameras - if you are lucky enough to have one of these cameras you can capture As with previous versions instructions and examples of useage are included in the videoInput.h file See the notes of previous releases for other features.
|
Example useage videoInput::listDevices(); //optional static function to list devices videoInput * VI = new videoInput(); //required class to manage all the cameras VI ->setPhyCon(0, VI_COMPOSITE); //optional (CAPTURE DEVICE TO SETUP, CAPTURE_CONNECTION) - use VI_COMPOSITE (defualt) for most VI ->setCaptureSize(0,CAM_W,CAM_H); //optional (CAPTURE DEVICE TO SETUP, CAPTURE WIDTH, CAPTURE HEIGHT) VI ->setup(0); //required (CAPTURE DEVICE TO SETUP) - 0 is the first device //for more than one camera VI ->setup(1); //required (CAPTURE DEVICE TO SETUP) - 1 is the second device unsigned char * frame = new unsigned char[VI->getSize(0)]; //optional (DEVICE NUMBER) - gets the buffer size of the image handed back //for more than one camera unsigned char * frame2 = new unsigned char[VI->getSize(1)]; //optional (DEVICE NUMBER) - gets the buffer size of the image handed back //idle loop if(VI->grabFrame(0, frame)) //required (DEVICE NUMBER, BUFFER BIG ENOUGH FOR IMAGE) - returns rgb image as a byte array { //generic function to load to a texture loadImageData(frame, VI->getWidth(0), VI->getHeight(0), GL_RGB); //use VI->width etc so that you don't get a crash } //for more than one camera if(VI->grabFrame(1, frame2)) { //generic function to load to a texture loadImageData(frame2, VI->getWidth(1), VI->getHeight(1), GL_RGB); //use VI->width etc so that you don't get a crash } //end idle loop Contact me at : theo [DOT] watson (AT) gmail [DOT] com . |
Latest Release: videoInput0.165 lib and src
Version 0.165 See the notes of release 0.16 bellow for code useage.
|
Latest Release: videoInput0.16 lib and src
Version 0.16 See the notes of release 0.155 bellow for code useage.
|
Latest Release: videoInput0.155 lib and src
Version 0.155
NOTE: THIS REVISION IS A MAJOR ONE AND THE CODE IS NOT THE SAME AS FOR PREVIOUS VERSIONS
|
//ONE CAMERA videoInput * VI = new videoInput(); //If you need to change the input //VI ->serPhyCon(VI_S_VIDEO); //if you need a size other than the default //VI ->setCaptureSize(0,320,240); VI ->setup(1); //try to setup two cameras. //set the buffer to the size we are capturing at unsigned char * frame = new unsigned char[VI->getSize(0)]; while(running) { if(VI->grabFrame(0, frame)) //do something with the image } //use VI->getWidth(0) VI->getHeight(0) to get image dimensions //use VI->getSize(0) for image size //TWO CAMERAS videoInput * VI = new videoInput(); //Only use if you need a different size than the default VI ->setCaptureSize(0,320,240); //Only use if you need a different size than the default VI ->setCaptureSize(1,320,240); VI ->setup(2); //try to setup two cameras. //set the buffer to the size we are capturing at unsigned char * frame = new unsigned char[VI->getSize(0)]; //set the buffer to the size we are capturing at unsigned char * frame2 = new unsigned char[VI->getSize(1)]; while(running) { if(VI->grabFrame(0, frame)) //do something with the image if(VI->grabFrame(1, frame2)) //do something with the image } |
Latest Release: videoInput0.13 lib and src
Version 0.13 - Added the setCaptureSize function which lets you capture at a
|
//Example Useage //Use grabFrame() instead of grabFrameRGB() //if you are converting to grayscale as it saves frames. //from one device VI = new videoInput(); int noOfDevices = VI->listDevices(); if(noOfDevices>0){ // capture from Composite //optional VI->setPhyCon(0); //use to capture at a non-default but compatabile size //optional VI->setCaptureSize(320,240); VI->start(0); VI->grabFrameRGB(buffer); //and now do something with the buffer } delete(VI); //that is it done! easy huh? //or for multiple devices VI = new videoInput(); VI2 = new videoInput(); int noOfDevices = VI->listDevices(); if(noOfDevices>0){ VI->setPhyCon(0); // capture from Composite VI->start(0); VI->grabFrameRGB(buffer); } if(noOfDevices>1){ VI2->setPhyCon(1); // capture from S-Video VI2->start(1); VI2->grabFrameRGB(buffer); } delete(VI); delete(VI2); |
Latest Release: videoInput0.12 lib and src
Version 0.12 Supports USB web cams and also to select the non default physical interface (ie S-Video) from a capture device.
|
//Example Useage //Use grabFrame() instead of grabFrameRGB() //if you are converting to grayscale as it saves frames. #include "videoInput.h" videoInput * myVideo1; videoInput * myVideo2; unsigned char * buffer1 = new unsigned char[320*240*3]; unsigned char * buffer2 = new unsigned char[320*240*3]; myVideo1 = new videoInput(); int noOfDevices = myVideo1->listDevices(); if(noOfDevices>0){ myVideo1->start(0); myVideo1->grabFrameRGB(buffer1); } delete(myVideo1); //that is it done! easy huh? //or for multiple devices (for the fancy pants) myVideo1 = new videoInput(); myVideo2 = new videoInput(); int noOfDevices = myVideo1->listDevices(); myVideo1->setPhyCon(0); // capture from Composite myVideo2->setPhyCon(1); // capture from S-Video if(noOfDevices>0){ myVideo1->start(0); myVideo1->grabFrameRGB(buffer1); } if(noOfDevices>1){ myVideo2->start(1); myVideo2->grabFrameRGB(buffer2); } delete(myVideo1); delete(myVideo2); |
Release: videoInput0.11 lib and src Version 0.11 has a number of changes most importantly in the way devices are listed please re-read the h file for info.
Info: To use just include the lib and header file thats all you need. The header file has info on how to use it - it is very easy to use just a few lines of code. The source is just two files videoInput.cpp and videoInput.h. There are two codewarrior 8 project files one builds a simple app which grabs one frame and writes to a raw file(320 by 240 RGB). The other compiles as a lib. Included are all the DirectShow libs and header files needed so you should only need codewarrior to compile. The streams.h file had to be modified to work for codewarrior and the correct src for the file is commented into the end of the videoInput.h file in case you need it. Things to note: The image handed back is BGR not RGBA - it can return RGB too but if you are going to convert it to black and white anyway just use the regular grabFrame call. You have to supply a unsigned char * buffer to the grabFrame function that is the right size for your device. If your device captures at 320 by 240, you need to have a buffer[320*240*3] at least so it can store the whole image. Tested on the Hauppauge WinTV Pro USB Capture card and the Pinnacle PCTV Card other cards probably work but I don't know for sure. Can handle multiple cameras as you can see above, needs a new instance of the class for each camera. This code is to make people's lives easier (hopefully) , I don't care how it is used. If you have bugs, questions, comments or improvements I would love to hear them. Contact me at : theo [DOT] watson (AT) gmail [DOT] com . |