How can i crop from input to output?

hello.
I use deepstream 5.0.

i need to crop the input source to the my pipeline
so i found the nvconvert , it have src-crop, dst-crop

i used it but i think it does not free the gpu buffer and does not re-allocate cropped size buffer
i found it using compositor, when i using compositor it present black padding except cropped region

can you tell me any other plugin crop the buffer?

What do you mean with “i found it using compositor”?

nvvideoconvert can re-allocate cropped size buffer. You need capsfilter in downstream to tell nvvideoconvert the output size you want.
For example, the following pipeline works as expected:

gst-launch-1.0 filesrc location=/opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_1080p_h264.mp4 ! decodebin ! m.sink_0 nvstreammux name=m batch-size=1 width=1280 height=720 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/config_infer_primary.txt ! nvvideoconvert src-crop=100:100:500:400 ! ‘video/x-raw(memory:NVMM),width=500,height=400,format=RGBA’ ! nvdsosd ! nvvideoconvert ! nvegltransform ! nveglglessink

What do you mean with “i found it using compositor”?

“when i use compositor i fount that”

nvvideoconvert can re-allocate cropped size buffer

do you mean i use nvconverter with src-crop and capsfilter
it will re-alloc the gpu memory?

Yes.

Thanks for reply it works!

but i tested something (c-application)
my pipeline works as below
src -caps(Width Height) -videoconvert-caps(nvmm)-queue-mux ----~~~
but
below pipeline does not work(linked error maybe)
src-caps(Width Height) -videoconvert-caps(nvmm)-videoconvert(src-crop) - caps(Width Height, nvmm) -tee -queue----~~~~

do you know why?

https://gstreamer.freedesktop.org/documentation/coreelements/capsfilter.html?gi-language=c#capsfilter-page
You need to list the whole gst-launch-1.0 pipeline or else nobody can know what is happenning.