#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> int main(int, char**) { cv::VideoCapture vcap; cv::Mat image; const std::string videoStreamAddress = "rtsp://admin:[email protected]:10554/udp/av0_0"; if (!vcap.open(videoStreamAddress)) { std::cout << "Error opening video stream or file" << std::endl; return -1; } cv::namedWindow("Output Window"); for (;;) { if (!vcap.read(image)) { std::cout << "No frame" << std::endl; cv::waitKey(); } cv::imshow("Output Window", image); if (cv::waitKey(1) >= 0) break; } }
时间: 2024-10-07 18:24:37