Displaying to the screen with OpenCV and GStreamer

Hi,
1- How I can use HW accelerate for encoding using gstreamer + opencv in python for writing to file?
2- How I can use HW accelaretor for decoding unsing gstreamer + opencv in python with nvv4l2decoder?
3- All codes of decoding and encoding are same and correctly wotrk for both Nano and Xavier NX?