How to make the scene monochrome (gst-dsexample)

hi all,
I’m trying to customize gst-dsexample to make it transform the incoming video stream into a mono (black and white) video.
I’m working on the function:

static GstFlowReturn
gst_dsexample_transform_ip (GstBaseTransform * btrans, GstBuffer * inbuf)

in the section dedicated to full-frame operations.
However I have no idea how to apply the filter to be able to make the scene monochrome.
thank you all

The gst-dsexample is a in-place mode transform plugin.

You can not do the transformation from a color video(usually RGB or YUV data) to a mono video(usually GRAY) with such plugin.

Do you want to use this function with DeepStream? What is your purpose? Does the nvinfer need “GRAY” input for inference?

hello, thanks for the reply!
Why is this not possible? in the example plug-in, there is a feature that allows you to blur parts of the scene. I can’t understand why grayscale of the whole image would be a different process.

The blur is done with the same NvBufSurface without change video format and buffer type. So the buffer is the same, and the caps are the same.
But convert color video to GREY video, the format changes, the caps changes, you can not use the same NvBufSurface to do this.
Do you know the difference between RGB/YUV and GREY?