Hi,
If you use Jetpack 4 release, a possible solution is to allocate RGBA NvBuffer, map it to cv::cudaGpuMat and then you can convert it to YUV420 by calling NvBufferTransform()
There is no sample exactly fitting your use-case but you can check this patch to get further information:
LibArgus EGLStream to nvivafilter - #14 by DaneLLL
For Jetack 5, the solution is the same except you would need to use NvBufSurface APIs.
Please check the document to get more information about jetson_multimedie_api samples:
Jetson Linux API Reference: Sample Applications | NVIDIA Docs