문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top