Skip to content

Instantly share code, notes, and snippets.

@dotchang
Created November 5, 2014 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotchang/3a5250b438da055626c8 to your computer and use it in GitHub Desktop.
Save dotchang/3a5250b438da055626c8 to your computer and use it in GitHub Desktop.
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
#ifdef _DEBUG
#pragma comment(lib, "E:\\opencv300\\build\\x86\\vc11\\lib\\opencv_world300d.lib")
#else
#pragma comment(lib, "E:\\opencv300\\build\\x86\\vc11\\lib\\opencv_world300.lib")
#endif
int main(int argc, char* argv[])
{
Mat frame;
namedWindow("video", 1);
VideoCapture cap("http://127.0.0.1:7890/ipvideo.mjpg");
while ( cap.isOpened() )
{
cap >> frame;
if(frame.empty()){
cout << "empty" << endl;
break;
}
imshow("video", frame);
if(waitKey(30) >= 0) break;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment