Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <opencv2/opencv.hpp>
- #include <iostream>
- int main(int, char**) {
- cv::VideoCapture vcap;
- cv::Mat image;
- const std::string videoStreamAddress = "replacewithyourstreamaddress";
- //open the video stream and make sure it's opened
- if(!vcap.open(videoStreamAddress)) {
- std::cout << "Error opening video stream or file" << std::endl;
- return -1;
- }
- while(1) {
- if(!vcap.read(image)) {
- std::cout << "No frame" << std::endl;
- cv::waitKey();
- }
- cv::imshow("Output Window", image);
- if(cv::waitKey(1) >= 0) break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement