0. Download IP Camera (Android software) and install
such as this (the icon is a gray camera of the software)
1. Create a new CPP file, compile
#include"opencv2/opencv.hpp"#include<iostream>using namespace std;using namespace CV;intMain () {Videocapture capture ("http://192.168.0.100:8080/video? dummy=param.mjpg ");if(!capture.isopened ()) cout<<"fail to open"<<Endl;Elsecout<<"Success!!!!!!!!!!!"<<Endl;return0;}
Notice the red string inside!! Must be added !!! Otherwise it is wrong!!! I have been looking for a long time to find the reason for this!!!
Add it to the reason:
OpenCV expects a filename extension for it videocapture argument, even though one isn ' t always necessary (as in your CA SE).
You can ' trick ' it by passing in a dummy parameter which ends in the mjpg extension:
The meaning is:
Although our Ipcamera does not have the suffix, but OpenCV is very silly, must have one. Mjpg and the like suffix to recognize , so cheat it , so add a
(2. If you do not do it, you will get an error)
file (.. /.. /MODULES/HIGHGUI/SRC/CAP_FFMPEG_IMPL.HPP:545)
3. References
Http://stackoverflow.com/questions/7266256/how-to-get-mjpg-stream-video-from-android-ipwebcam-using-opencv
Google search: "OpenCV android IP Camera"
It took me two days to toss Ah!!!
OpenCV Connect Android IP Camera