Plugin customization with OpenCV

I am trying to build a plugin that calculates the Optical Flow between consecutive frames and then apply the matrix transformation to the current frame, i am following the DsExample:

• Hardware Platform (Jetson / GPU) Jetson Nano
• DeepStream Version 6.0
• JetPack Version (valid for Jetson only) 4.6.1 (Linux 32.7.1)
• TensorRT Version 8.2.1.9
• Issue Type( questions, new requirements, bugs) Question
• I am following the right “tutorial” with this code or the stuff i am looking for is something more like a video filter?
• if so, how can i get the current full frame in the “gst_dsexample_transform_ip” and how can i moddify it later to make the output of my modifications so it is the output frame of the plugin.

Any suggestion is welcome.

Will the output frame be in different format or resolution comparing to the input frame?

Yes, the output frame will be in the same format and resolution as the input frame.

The video frame is in the NvBufSurface.NVIDIA DeepStream SDK API Reference: NvBufSurface Struct Reference | NVIDIA Docs

Please refer to DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums for how to modify the NvBufSurface.