Opencv () buffer


I develop an application that should stop the operation of an equipment as soon as a person is detected (object detection).

I need the image in real time, but with I have a delay of about 1s.

cam = cv2.VideoCapture (urlcamera)
s, im = ()

Does anyone know how to work around this problem?