Thread: MJPG lag OpenCV
View Single Post
  #12   Spotlight this post!  
Unread 05-03-2014, 12:55
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: MJPG lag OpenCV

There is a constant lag of 10 seconds. The 15fps is the max I allow the camera to send. Also, I actually think the program is already running at 15 fps. I have a timer and I just do a frequency calculation, so running at ~50ms lag, I get 60fps. I believe that the program is actually running at 15fps already. I doubt the problem is with my processing because when I run from my internal camera with 4 times the resolution, I get very little lag.

Here is my retrieval code:

PHP Code:
CvCapture *cam1 NULL//null required on linux otherwise crash will occur
cam1 cvCaptureFromFile("http://10.11.65.13/mjpg/video.mjpg");
while(
1) {
    
Mat rawImg cvQueryFrame(cam1);
    if(
trackTargets) {

    }
    if(
trackBalls) {

    }
    if(
trackRobots) {

    }
    
imshow("Window"rawImg);
    
waitKey(1);  //1 is lowest possible