How to overlay and encode custom data on NvVideoConverter's Dequeued capture plane buffer?

I have a transcoder pipeline where connections are made as shown below by updating sample applications provided as part of tegra_multimedia_api(on TX2 L4T 27.1),

<File Read -> NvVideoDecoder -> NvVideoConverter -> NvVideoEncoder -> File Write>

I am trying to overlay custom data on the YUV at converters output and then encode the data. I have verified the overlay by dumping the YUV frames after the overlay logic and it seems fine for all the frames.

However, encoding the same and playing the encoded file shows corruption in the overlaid region.
Any idea why such a behavior could happen?

Is this because the memory allocated by the converter is cached? If so can we invalidate the Cache settings for the buffers?

Regards,
Shashank

PLease use r28.1 or later release and refer to
https://devtalk.nvidia.com/default/topic/1026106/jetson-tx1/usage-of-nvbuffer-apis/post/5224382/#5224382

DaneLLL,

Thank you for the quick response.
Is there a way this can be done on r27.1?
Because we have dependencies on this version in our media system, updating L4T will be tricky.

If possible can you share some patches or updated libraries for the CPU sync APIs?

Regards,
Shashank

The deviation is significant so we would like you to upgrade to new release.