main.cpp
1 | #include <iostream> |
---|---|
2 | #include <sstream> |
3 | #include <unistd.h> |
4 | #include <opencv/cv.h> |
5 | #include <opencv/highgui.h> |
6 | |
7 | CvCapture * capture; |
8 | int count = 0; |
9 | |
10 | int main(){
|
11 | |
12 | capture = cvCreateFileCapture("rtsp://admin:[email protected]");
|
13 | |
14 | for ( ; ; ) {
|
15 | |
16 | IplImage * frame = cvQueryFrame(capture); |
17 | std::cout << "tick " << count << std::endl;
|
18 | std::ostringstream name; |
19 | name << count++ <<".jpg";
|
20 | cvSaveImage((name.str()).c_str(), frame); |
21 | |
22 | usleep(50000);
|
23 | |
24 | } |
25 | |
26 | return 0; |
27 | |
28 | } |