OpenCV Connect Android IP Camera

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.