R32.3.1 tx2-4g nvvidconv problem

Setting left=1682 right=1692 top=900 bottom=900 makes a frame with zero rows and 10 columns. This cannot be displayed.

You may also set a framerate. Using a RPi v2 camera that can only do 3264x2464@21fps, this works:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3264,height=2464, framerate=21/1' ! nvvidconv left=1682 right=1692 top=900 bottom=910 ! 'video/x-raw(memory:NVMM),width=10, height=10' ! nvegltransform ! nveglglessink window-width=480 window-height=380

@DaneLLL and @Honey_Patouceul

those are crop numbers so 3864-1692-1692 = 480 and 2180-1800 = 380

take a 8m camera and display the cropped middle section of the frame, make it 480x380, if this is wrong, please give me the correct nvvidconv params, these worked before

Also my main display is a Mipi DSI display 480x800, is it possible that something is not set correctly and nvvidconv is confused by the display size.

what does nvvidconv use as the display size? How do I display the display size info.

When I run this command a box flashes very quickly on my actual display but nothing gets displayed, so nveglglessink understands the display, it appears that nvvidconv is the problem.

Terry

In the link of my first post here:

So you would do (using -v with gst-launch will show the caps at each plugins ends) so you can see what is the resolution at nvvidconv output (src) :

gst-launch-1.0 -v nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3864,height=2180' ! nvvidconv left=1692 right=2172 top=900 bottom=1280 ! 'video/x-raw(memory:NVMM), width=480, height=380' ! nvegltransform ! nveglglessink window-width=480 window-height=380

yes that worked. Still confused how it worked before, but I have something to work with now,

Thanks,
Terry

@Honey_Patouceul nvvidconv seems to be ignoring my top/bottom/left/right and is maintaining the aspect ratio, left/right might used, but the image is not filling the complete height of 380

I remember seeing a ignore-aspect or something similar but nvvidconv does not have any aspect parameter.

Thanks
Terry

Please post the pipeline so that I can reproduce and figure out what could be the cause.
Do you crop with a ROI smaller than 480x380 ?
You may try adding pixel-aspect-ratio=1/1 into the output caps of nvvidconv.

@Honey_Patouceul and @DaneLLL

So yes the app is changing the values on the fly, but zoom is working, you can see the values all changing. zoom reset works set the numbers back to the original.

Then topDown just tries to move the video in the window, topDown moves the top of the video down so the video should move up in the window, and it fails. Is it complaining that left/right are not changing?

Where does this message come from I would really like to add values to it so I can see what it thinks left is and what it things width really is.

SrcCrop rect’s left must not be greater than width

zoom(1098) b4 top 520 b 1660 l 1212 r 2652
zoom(1106) after top 576 b 1604 l 1312 r 2552

zoom(1098) b4 top 576 b 1604 l 1312 r 2552
zoom(1106) after top 632 b 1548 l 1412 r 2452

zoom(1098) b4 top 632 b 1548 l 1412 r 2452
zoom(1106) after top 688 b 1492 l 1512 r 2352

zoom(1098) b4 top 688 b 1492 l 1512 r 2352
zoom(1106) after top 744 b 1436 l 1612 r 2252

zoomReset(1126) b4 top 744 b 1436 l 1612 r 2252
zoomReset(1134) after top 520 b 1660 l 1212 r 2652

topDown(1177) b4 top 520 b 1660 l 1212 r 2652
topDown(1183) after top 620 b 1760 l 1212 r 2652
SrcCrop rect’s left must not be greater than width
nvbuffer_transform Failed
gst_nvvconv_transform: NvBufferTransform Failed
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:camera: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstNvArgusCameraSrc:camera:
streaming stopped, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstQueue:q1: Internal data stream error.
Additional debug info:
gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:pipeline0/GstQueue:q1:
streaming stopped, reason error (-5)

Thanks,
Terry

Hi,
We don’t support changing the settings on the fly in nvvidconv plugin. For this usecase, it is better to use jetson_multimedia_api to have more flexibility.

so where is the example of how to use gstreamer and the jetson_multimedia_api to replace the nvvidconv plugin?

Why does it work sometimes and not other times?

Terry

@Honey_Patouceul any input, it appears Nvidia is asking me to dump gstreamer for jetson_multimedia_api,

Need input on why nvvidconv works with some top/bottom/left/right numbers and breaks on other numbers

Thanks,
Terry

Although I’m curious, I don’t have so much time for trying your case. Again, you may help providing some code reproducing the error so that is easier to try.

I made a quick test with gstreamer in python and found similar errors with crop out of boundaries or NvDdkVicConfigure/nvbuffer_transform failures. Seems related to nvvidconv output resolution, but unsure if Argus can also be affected or not by this and I am unable to figure out the cause for now.

What seems to be an easier path would be trying new buf api and nvvideoconvert (not sure, it may require deep-stream plugins).

Try the following and share by modifying this example for easier help:

#!/usr/bin/env python

import signal
import sys
import time
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject

# Signal handler for stopping pipeline before destruction, so that Argus keeps ok.
def signal_handler(sig, frame):
    p.set_state(Gst.State.NULL)
    sys.exit(0)

# Initialize gstreamer
GObject.threads_init()
Gst.init(None)

# Define pipeline 
gst_str = "nvarguscamerasrc sensor-id=0 bufapi-version=1 ! video/x-raw(memory:NVMM),format=NV12,width=1920,height=1080,framerate=30/1 ! nvvideoconvert name=cropper nvbuf-memory-type=4 ! capsfilter name=cflt caps=\"video/x-raw(memory:NVMM),width=480,height=380,pixel-aspect-ratio=1/1\" ! nvegltransform ! nveglglessink window-width=480 window-height=380"

# Create the pipeline
p = Gst.parse_launch (gst_str)
if not p:
    print('Failed to launch pipeline. Aborting')
    exit

# Register signal handler for proper termination if receiving SIGINT such as Ctrl-C
signal.signal(signal.SIGINT, signal_handler)

# get cropper component
cropper = p.get_by_name("cropper")
#print(cropper.get_property("src-crop"))
#print(cropper.get_property("dest-crop"))

# Get capsfilter output element
cf = p.get_by_name("cflt")
if not cf :
    print('Failed to get cf')
    p.set_state(Gst.State.NULL)
    exit(-1)
ocaps= cf.get_property('caps')
print ocaps.to_string()


# Start the pipeline
p.set_state(Gst.State.READY)
p.set_state(Gst.State.PAUSED)
p.set_state(Gst.State.PLAYING)
# Run for 5s 
time.sleep(5)


print('Set top at 540')
#p.set_state(Gst.State.PAUSED)
new_caps = Gst.Caps.from_string("video/x-raw(memory:NVMM),format=NV12,width=1920,height=540,pixel-aspect-ratio=1/1")
cf.set_property("caps", new_caps)
cropper.set_property('src-crop', '0:540:1920:1080')
print cf.get_property('caps').to_string()
#p.set_state(Gst.State.PLAYING)
# Run for 5s 
time.sleep(5)


print('Set left at 960')
#p.set_state(Gst.State.PAUSED)
new_caps = Gst.Caps.from_string("video/x-raw(memory:NVMM),format=NV12,width=960,height=540,pixel-aspect-ratio=1/1")
cf.set_property("caps", new_caps)
cropper.set_property('src-crop', '960:540:1920:1080')
print cf.get_property('caps').to_string()
#p.set_state(Gst.State.PLAYING)
# Run for 5s 
time.sleep(5)


# Done. Stop the pipeline before clean up on exit.
p.set_state(Gst.State.NULL)
exit(0)

gst-inspect-1.0 nvvideoconvert
No such element or plugin ‘nvvideoconvert’
tbuckley@BaseSystem_0_5:~/tmp$

where and how do I get this nvvideoconvert?

Thanks,
Terry

I looked in the kernel and SrcCrop is not defined, where is the source code that produces this error.

ScrCrop rect’s left must not be greater than width.

Terry

More information please, can I use deep-stream plugins with gstreamer?

Terry

Yes, just install deepstream and you should be able to use the DS plugins.

pointer to how to install deepstream please?

Terry

Goggling for ‘deepstream install jetson’ should be a good enough for getting this.

@Honey_Patouceul @WayneWWW Thanks but that is for r32.5.1, and I am on r32.3.1, do you or a Nvidia person have the correct pointer to r32.3.1,

Also I am on a tx2-4g, and if deepstream needs cuda to be installed, I will fail for disk space problems, This is bring back some old nightmares, so lets see what if get for help.

Really need help on this one Nvidia.

Terry

I looked into Announcement in this forum and checked the R32.3.1 release where I see it should be DS-4.0.2.
You would find this version here(being logged).
You may follow these instructions (Jetson Setup/To install the DeepStream SDK/Method 2: Using the DeepStream tar package)

Note that the code I’ve posted above was only tested on NX with R32.5.1 and DS5.

I’ve just found that most of the crop parameters in my commands were not correct wrt to output resolution, sorry for approximative advice…
See :