如何从Android的IPWebcam使用OpenCV的获得MJPG流视频视频、IPWebcam、Android、MJPG

2023-09-05 04:10:52 作者:帅到不像话

我使用Android上的IP网络摄像头程序,并接受它我的电脑通过无线网络上。我要的是使用OpenCV的在Visual Studio中,C ++,来获取视频流,有一个选项,通过以下网址获得MJPG流:的http:// MYIP:端口/ videofeed 如何使用OpenCV的得到它?

I am using the IP Webcam program on android and receiving it on my PC by WiFi. What I want is to use opencv in Visual Studio, C++, to get that video stream, there is an option to get MJPG stream by the following URL: http://MyIP:port/videofeed How to get it using opencv?

推荐答案

老问题,但我希望这可以帮助别人(同这里我的答案)

Old question, but I hope this can help someone (same as my answer here)

OpenCV的期望一个文件扩展名的VideoCapture的说法,   即使1并不总是必要的(如在你的情况)。

OpenCV expects a filename extension for its VideoCapture argument, even though one isn't always necessary (like in your case).

您可以欺骗它通过传递在其结束一个虚拟参数    MJPG 扩展:

You can "trick" it by passing in a dummy parameter which ends in the mjpg extension:

因此​​,也许尝试:

VideoCapture vc;
ipCam.open("http://MyIP:port/videofeed/?dummy=param.mjpg")