Read Actual Data from a GstBuffer

I have a pipeline that processes images.
I’m trying to understand how do I access the actual contents of the gst buffer. I tried gst_buffer_map api, and GstMapInfo and some other things. But I get loads of Information.
I only want to access the image, can anyone help me in that ?

to give more info of my pipeline.
Source element is URIDecodeBin and I run it with RTSP.
I can give more info on the stream coming through RTSP if that is required.

What does your pipeline look like and where do you get the buffer from? (appsink?)

What kind of format (caps) is the buffer in?

Is it a decoded raw video buffer, or does it contain encoded data or?

My Pipeline looks like this
uridecodebin → nvvideoconvert → nvstreammux → some_plugin-1 → some_plugin-2 → sink

what my pipeline does :- It works on RTSP stream, The URIDecodebin gets the RTSP stream from camera, the next element that is nvvideoconvert does some Region of interest cropping and sends this crop to the further elements in the pipeline.

what I want to do :- I want to obtain the full FOV image that URIDecode bin receives.

why ? :- because I want to attach that full FOV image to the buffer as custom metadata and pass it along the buffers in the pipeline.

as of now, I have a probe function at the source pad of the uridecodebin, and I’m getting buffer from there.

what I

Can you share the exact caps between uridecodebin and nvvideoconvert?

What decoder is being used inside uridecodebin?

There is special API to map raw video buffers, see gst_video_frame_map and the code example in the documentation.

It sounds like you might be interested in the originalbuffersave and originalbufferrestore elements which are available in gst-plugins-rs (main branch only for now).

Yes. This was helpful. I will share the caps soon.
also, will check the two plugins that you mentioned.