Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
214 views
in Technique[技术] by (71.8m points)

IP Camera with opencv: error ffmpeg

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:[email protected]/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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...