问题
i am using VIVOTEK IP camera. I am trying to interface it with OPENCV. internet explorer shows fine video at this url, after entering username and password.
the code is given below
const std::string videoStreamAddress ="http://192.168.100.128/main.html";
//i have also tried "http://username:pasword@192.168.100.128/main.html" but the same
//result
//and also tried ""http://192.168.100.128" i.e without "main.html"
if(!vcap.open(videoStreamAddress))
{
std::cout << "Error opening video stream or file" << std::endl;
}
I got the following error
warning: Error openong file <../../modules/highgui/src/cap_ffmpeg_impl.hpp:529>
Error opening video stream or file
what can be the problem?
回答1:
The URL which you have given is the problem. You can use url something like this
"http://username:password@ipOfCamera/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=30&.mjpg"
Or another option is to download iSpy software and use IP camera wizard where it finds the URL for you and gives the best choice for the camera you are using. I did use this approach. Heres the code which worked for me. as far as you want to get the live feed from the IP Camera. Here's the list of URL which can be used to get the video from your IP Camera..
来源:https://stackoverflow.com/questions/16455345/ip-camera-with-opencv-error-ffmpeg