本文介绍了opencv是否可以读取视频流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于此流:
是否存在可以捕获流以进行操作的类?
is there a class that can capture the stream for manipulation?
我发现的所有内容都是有关如何制作客户端服务器或从与计算机连接的cam中读取内容的教程.
all i found was tutorials about how to make client server, or read from computer connected cam.
更新:看起来很有希望.尝试再次打开这失败,因此我跟随了asx说:
Update:it looks promising.trying to open this again failed , so i followed the asx which said:
<asx version="3.0">
<!-- GMEmbed -->
<title>CastUP: Ayalon</title>
<entryref href="http://switch3.castup.net/cunet/gm.asp?format=wm&s=4A59334AD43141A7BFD73D7CE6B71560&ci=15369&ak=35143679&ClipMediaID=21329&authi=&autht=&dr=" />
</asx>
因此尝试了此,但它也没有打开(在cap.isOpen == false上也是如此.
so tried this which also didn't open(on cap.isOpen == false), too.
有什么建议吗?
来源:
Mat frame;
VideoCapture Ayalon("http://switch3.castup.net/cunet/gm.asp?format=wm&s=4A59334AD43141A7BFD73D7CE6B71560&ci=15369&ak=35143679&ClipMediaID=21329&authi=&autht=&dr=");
int delay = 1000/Ayalon.get(CV_CAP_PROP_FPS);// (1 second / fps) = delay between frames
bool stop(false);
if (!Ayalon.isOpened())
return 1;
namedWindow("ayalon Stream");
while (!stop) {
if (!Ayalon.read(frame))
break;
imshow("ayalon Stream",frame);
if (waitKey(delay) >0 )
stop = true;
}
Ayalon.release();
waitKey(7000);
return 1;
推荐答案
是的,很好的功能是该代码与从相机读取的代码完全相同-请参见读写图像和视频
Yes and the nice feature is that the code is exactly the same as reading from a camera - see Reading and Writing Images and Video
这篇关于opencv是否可以读取视频流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!