How to push rtmp stream to nginx server with nvenc?

My task pipeline is to receive image frames from rtsp stream, do some processing for these images, and finally need to encode these processed image with nvenc, push to nginx rtmp server.

I have no idea how to make it, is there any suggestion or example for that? How to encode these images with hardware and push to rtmp server?