VideoCapture() does not work with udp protocol

You don’t need to do anything with VideoCapture.

Your camera has to work with FFmpeg/FFplay.

If you cannot access your camera with FFmpeg then it won’t work with OpenCV.