Nvvidconv crop failed

Hi

I am trying to crop image on TX2 using nvvidconv

I am using Jetpack version 28.2.1 and gstreamer version 1.8.3

My pipeline is working well using the nvvidconv element without setting properties

BUT when I am trying to set any of crop property (top,bottom,left,right) I get critical error from my pipeline

do you know what the reason for that error?

Hi,
Please share the pipeline and the reported error.

Be aware that, as opposed to videocrop, nvvidconv parameters are not the margins, but the X or Y coordinates.
For top and left these are the same as with videocrop, but you would set:
right = width - rightMargin
and
bottom = height - bottomMargin.

Example removing 100 columns on left and right and 100 rows on top and bottom from a 640x480 frame giving a 440x280 frame:

gst-launch-1.0 -v videotestsrc ! video/x-raw, format=YUY2, width=640, height=480, framerate=30/1 ! nvvidconv left=100 right=539 top=100 bottom=379 ! 'video/x-raw(memory:NVMM), width=440, height=280' ! nvvidconv ! xvimagesink

The above information is important to know and at odds with current documentation.

gst-inspect-1.0 nvvidconv outputs:

  left                : Pixels to crop at left
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  right               : Pixels to crop at right
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  top                 : Pixels to crop at top
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  bottom              : Pixels to crop at bottom
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 

However, setting those values to 0 crashes the pipeline.

FYI the Accelerated GStreamer User Guide. shows an example of how to use nvvidconv for scaling:

gst-launch-1.0 videotestsrc ! \
 'video/x-raw, format=(string)I420, width=(int)1280, \
height=(int)720' ! nvvidconv ! \
 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, \
 format=(string)I420' ! omxh264enc ! \
 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! \
 qtmux ! filesink location=test.mp4 -e

I’ve edited my post above for fixing an error. width would be right - left +1 and height would be bottom - top + 1.This may be required for keeping pixel-aspect-ratio tp 1/1.