在VC ++中使用openCV的IP摄像机视频流 [英] IP camera video streaming using openCV in VC++
本文介绍了在VC ++中使用openCV的IP摄像机视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从未编写过VC ++应用程序,现在我被分配了一个任务,即捕获IP摄像机并将其另存为硬盘上的文件.
I have never written VC++ apps and now i am assigned a task of capturing IP camera and saving as files on the harddisk.
我最近2天都在冲浪,但找不到适合的链接或代码.
i was surfing for last 2 days but cant find any suitable link or code for the same.
我在网上找到的示例代码捕获了网络摄像头,但与使用凭据的rtsp协议读取视频流没有关系.
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
推荐答案
下面是访问公共IP摄像机的代码段,
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
这篇关于在VC ++中使用openCV的IP摄像机视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文