Howto OPENCV+CUDA+VideoCapture?

I have a machine with 2 Nvidia RTX GPU. The main task is to decode an h264 video from an IP camera and encode raw frames to JPEG with GPU. I built opencv + cuda from sources by: cmake -D