Hi,
It looks like the UV plane is with wrong value in the case. Please run
gst-launch-1.0 pylonsrc imageformat=Mono8 ! video/x-raw,format=GRAY8 ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! dsexample ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=a.mp4
And you can access the buffers in dsexample plugin. You can apply the logic in nvbuff_do_clearchroma() for a try.
nvbuff_do_clearchroma() is in
/usr/src/jetson_multimedia_api/samples/12_camera_v4l2_cuda
and implemented with NvBuffer APIs. You can do the same with NvBufSurface APIs.