I am working on latest distro of Ubuntu on Codeblocks and trying to compile this code
/*
* Acquisition over network cameras. Seem to work only with ffmpeg
*
* For macosx users, install ffmpeg (e.g. from fink) and recompile opencv this way
*
http://stackoverflow.com/questions/583969/compile-opencv-on-mac-with-ffmpeg-instead-of-quicktime *
*/
#include "cv.h"
#include "highgui.h"
#include <iostream>
#define MISSING_FRAMES_TIMEOUT 10
using namespace std;
// Uncomment if you have OpenCV + FFMPEG
#define HAVE_FFMPEG
#ifdef HAVE_FFMPEG
extern CvCapture* cvCreateFileCapture_FFMPEG( const char* filename );
#endif
/**
* Main entry point of Motion. Launches all the motion threads and contains
* the logic for starting up, restarting and cleaning up everything.
*/
int main (int argc, char **argv) {
#ifdef HAVE_FFMPEG
/* If i is 0 it means no thread files and we then set the thread number to 1 */
string host("
http://at@15.12.156.145/mjpg/video.mjpg");
CvCapture *capture = cvCreateFileCapture_FFMPEG(host.c_str());
string winBlobsName("Camera over network");
cvNamedWindow(winBlobsName.c_str());
while (capture) {
// Grab frame
int grab=cvGrabFrame(capture );
if (grab<0) {
cerr << "Error in capturing frame\n" << endl;
break;
}
// Retrieve frame
IplImage *img = cvRetrieveFrame(capture);
cvShowImage(winBlobsName.c_str(),img);
cvWaitKey(2);
}
#endif
return 0;
}
It requires Opencv and ffmpeg which I installed earlier. But when Im trying to compile the code it tells me
Compiling: main.cpp
g++: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
If I try to run it it will say that it seems like this project has not been built yet. Would you like to build it? I say yes, it asks me the same question once more I say yes again and then nothing.
If I put in some simple code like hello world it works fine. Did anyone encounter this kind of problem before?