opencv RTSP拉流

#include "opencv2\opencv.hpp"
#include 

using namespace cv;

int main()
{

  VideoCapture capture;
  capture.open("../../bin/data/1.mp4");
  //capture.open("rtsp://admin:[email protected]: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);
  }
}

你可能感兴趣的:(opencv RTSP拉流)