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

Hi
I have been reading https://developer.download.nvidia.com/embedded/L4T/r32-2_Release_v1.0/Accelerated_GStreamer_User_Guide.pdf.
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).

Hi,
You may refer to the example of using test-launch:
[url]https://devtalk.nvidia.com/default/topic/1018689/jetson-tx2/vlc-playing-gstreamer-flow/post/5187270/#5187270[/url]

For running v4l2 source, you can check
[url]Logitech C930e on Jetson TX1 very slow and choppy video - Jetson TX1 - NVIDIA Developer Forums