I recently tested the video capability with mit Logitech QuickCam Communicate STX using the "macam" drivers. It worked like charm, but I didn't get a good framerate - but this should be a camera problem!
1. GET OPENCV SOURCES
So then let's start. The first thing we need are the OpenCV source files. Just follow the previous guide and use a svn client to get the actual data.
>> svn co
https://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/trunk'
2. INSTALL FFMPEG
We also have to install the "ffmepg" which is done by using the macports. Just type
>> sudo port -v install ffmpeg
This should take a while. Meanwhile you can get acquainted with CMake. So now we have to solve a little problem. Since OpenCV tries to find the ffmpeg header files only in "/opt/local/include" we will have to copy them there to make sure that the CMake-Script will find them. I know that isn't the cleanest solution, but I couldn't think of something more "advanced", so if you have another solution feel free to post it.
So to get everything to work just search for the folders
- libavcodec
- libavdevice
- libavfilter
- libavformat
- libavutil
3. INSTALL CMAKE
Next thing we have to do is get a copy of CMake. You can get the newest release on the projekt hompage "http://www.cmake.org/". Install it and Open the CMake-GUI.
Start the application and ook for the "Where is the source code"-line and browse to the OpenCV folder where your svn client put the data. In the following I'll call this directory OPENCV_DIR. Create a folder, say "_make" in the OPENCV_DIR and put the path into "Where to build the binaries"-line in CMake. Now hit the "Configure"-button and CMake will ask you which compiler you want to use. Just use the default one which should be XCode, if you have installed the IDE already. After configuring you will see a reed colored window with many compile-options.
In the text output you should find entries that tell you, that "libavformat - found" and and the result tabular in the ffmpeg-section should be a line that says "gentoo-style: 1". If this is the case everything worked out just fine and we can go on to configure OpenCV.
4. COFIGURING OPENCV USING CMAKE
This is something individual, but my settings should work for most of you out there - everyone who need a different setting should know what to do when reading the parameter list. So do the following:
Uncheck:
- BUILD_EXAMPLES
- BUILD_TEST
Make sure you are in the debug mode and compile your OpenCV programm. The debug mode will work out just fine. I haven't had luck with the release mode though - XCode doesn't seem to find the libraries anymore and I have absolutely no clue why...