Ask Your Question

sim's profile - activity

2017-06-13 13:23:06 -0500 received badge  Taxonomist
2016-12-21 03:54:40 -0500 received badge  Notable Question (source)
2015-04-15 18:40:41 -0500 received badge  Popular Question (source)
2013-02-11 23:57:12 -0500 commented answer OpenCV code for network camera working for axis not canon

Thanks a lot. Its working now.

2013-02-11 23:56:37 -0500 received badge  Scholar (source)
2013-02-11 08:20:17 -0500 asked a question OpenCV code for network camera working for axis not canon


I am using an open cv code to display video from network camera. For axis camera it's working. but for canon VB-c50i, its not showing anything. This is the url I am using http://username:password@x.x.x.x/-wvhttp-01-/GetOneShot?image_size=320x240&frame_count=no_limit. I am able to stream video if I use this url in internet browser but not with opencv

Code is working fine for axis camera. Can someone help. This is the code

int main(){

CvCapture *camera=cvCaptureFromFile("http://username:pass@cam_address/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=30&.mjpg");
if (camera==NULL)
    printf("camera is null\n");
    printf("camera is not null");

while (cvWaitKey(10)!=atoi("q")){
    double t1=(double)cvGetTickCount();
    IplImage *img=cvQueryFrame(camera);
    double t2=(double)cvGetTickCount();
    printf("time: %gms  fps: %.2g\n",(t2-t1)/(cvGetTickFrequency()*1000.), 1000./((t2-t1)/(cvGetTickFrequency()*1000.)));