Not sure how to do the implementation, but the code should be in gst_omx_h265_enc_handle_output_frame() or gst_omx_video_enc_handle_output_frame(). You may modify it and rebuild/replace libgstomx.so.
Yes this pipeline is working.
avdec_h265 is CPU based, so has its overhead.
Strange is omxh265dec is not working.
Once my Nano comes, I will install latest L4T. And will check with omxh265enc-nvv4l2h265dec & nvv4l2h265enc-nvv4l2h265dec.
Intention is hardware h265 codec without h265parse.