Videocapture grab() timeout for Gstreamer

How can I change cap.grab() timeout? Cause now when I disconnect my camera from network, it just freeze for 20s and i dont know how to change this timeout(i`ve tried many things)

related: