IP camera video streaming using openCV in VC++

狂风中的少年 提交于 2019-12-09 02:04:02

问题


I have never written VC++ apps and now i am assigned a task of capturing IP camera and saving as files on the harddisk.

i was surfing for last 2 days but cant find any suitable link or code for the same.

the sample code i found on the net, captures webcam but nothing relevent to reading video streams on rtsp protocols with credentials.

please help me for this.. Thanks & Regards


回答1:


The below is the code snippet which accesses a public ip camera, which works fine for me.

int main(int argc, char *argv[])
{
    Mat frame;
    namedWindow("video", 1);
    VideoCapture cap("http://66.184.211.231/mjpg/video.mjpg");
    while ( cap.isOpened() )
    {
        cap >> frame;
        if(frame.empty()) break;

        imshow("video", frame);
        if(waitKey(30) >= 0) break;
    }

    return 0;
}

And here are few link for your reference link1 link 2



来源:https://stackoverflow.com/questions/18892370/ip-camera-video-streaming-using-opencv-in-vc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!