i have succcessfully implemented TLD and face detection algorithms in opencv on realtime webcam stream and it shows realtime response . Then i wanted to do the same on ipcamera video stream . Firstly , i tried ipcamera video streaming using opencv ( without object detection) and it had almost no lag (nearly realtime). when i altered to process it, it gives same fps but gets delayed by 3-4 seconds . Found on internet there is something like buffers in which image frames of ip camera stream is stored and causes delay but couldnt solve the problem.
some of my relevant code :
VideoCapture captureDevice;
string videoStreamAddress = "http://admin:admin@192.168.0.251:80/video/mjpg.cgi?&.mjpg";
// in loop
captureDevice>>frame;