opencv RTSP拉流
2019-07-12 本文已影响0人
Caiaolun
#include "opencv2\opencv.hpp"
#include <iostream>
using namespace cv;
int main()
{
VideoCapture capture;
capture.open("../../bin/data/1.mp4");
//capture.open("rtsp://admin:admin123@192.168.1.164:554/cam/realmonitor?channel=1&subtype=0");
int frameH = capture.get(4);
int frameW = capture.get(3);
std::cout << "frameH:" << frameH << " frameW:" << frameW << std::endl;
while (1)
{
Mat frame;
capture >> frame;
if (frame.empty())
{
break;
}
imshow("test", frame);
waitKey(30);
}
}