How to perform H.265 encoding on V4L2 cam and publish on ROS network?

I have been reading
But couldn’t able to figure out the best way to publish on ROS, H.265 encoded stream of V4L2 cam.

I think that I would be using

nvv4l2h265enc   //(NVIDIA Accelerated Encoding)

somewhere and would be needing to design a ROS custom msg to carry encoded bits with time-stamp. Later on, the custom msg would be decoded back into an image at client side.

I couldn’t able to design c++ code blocks which can encode @server, {encoded-bytes} and decode@client.

Can someone shed some light on probable solution of this problem.
I need time-stamp to measure delay. And, I have to perform some opencv operations also @client. Major intention is perform encoding as soon as fresh V4L2 image is available (minimum latency).

You may refer to the example of using test-launch:

For running v4l2 source, you can check