Hi,
Please try eenav’s suggestion to set bitrate in gst-launch-1.0 command. If your source runs in steady frame rate, the bitrate should be close to the setting.
Looks like it uses software codec in the OpenCV code. For using hardware encoding/decoding, you can refer to this sample: