How to pass to hardware encoder from OpenCV

Hi,
Please refer to this sample:
Displaying to the screen with OpenCV and GStreamer - #9 by DaneLLL