Hi, I am not very familiar with opencv, here is the command for your reference.
http://wiki.veye.cc/index.php/V4L2_mode_for_Raspberry_Pi#Stream_to_OpenCV
Also, I think this link below will be helpful to you.
https://qengineering.eu/install-gstreamer-1.18-on-raspberry-pi-4.html