Gstreamer trouble converting from I420 to RGB with videoconvert ?

Hi There

I’m somewhat new to this and am trying to evaluate an IMX327 bought from Leopard Imaging with the adapter kit.

I’m trying to convert the I420 stream from the sensor to RGB and display with the following

nvidia@tegra-ubuntu:~$ gst-launch-1.0 nvcamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)60/1’ ! videoconvert ! ‘video/x-raw(memory:NVMM), format=(string)RGB’ ! autovideosink
WARNING: erroneous pipeline: could not link videoconvert0 to autovideosink0

but as you can see I have no joy, works fine if I leave the format as I420 but I can’t convert it to RGB.

Any advice much appreciated.

kind regards
Nigel.

I think autovideosink expects NV12 or I420 format in NVMM memory. This should work:

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' ! autovideosink

If you need to convert into RGB for an application, the pipeline may look like this:

nvcamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' ! nvvidconv ! 'video/x-raw, format=BGRx' ! videoconvert ! 'video/x-raw, format=RGB' ! appsink

Hi Honey_Patouceul

Thanks for your reply.
Your second pipeline looks similar to some of my previous attempts but I’m not sure what appsink does or how to work with it.

Is there any easy way to just display the stream on screen as rgb? At this stage I’m just trying to evaluate the sensor and want to run some tests.

kind regards
Nigel.

appsink is the application that will launch the gstreamer pipeline and read its frames.
For example, with opencv (if it has gstreamer support), videoCapture(gst) where gst is the pipeline string would launch the pipelne, and if it succeeds then videoCapture.read would get each frame in RGB format.

gstreamer would handle the RGB format, but you need a display sink accepting this and I don’t know any I could advise.
With opencv you would use imshow for display. Check this opencv/python example (simplistic, you may add error checking).

Ah right, thank you…

Ok, strangely the issue seems to be solved by this. if you specify no sink options for videoconvert rgb is the default.

gst-launch-1.0 nvcamerasrc sensor-id=0 contrast=1 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)60/1’ ! videoconvert ! autovideosink

now if i could only get Aelock to obey true I’d be happy…

Hi nigel, for advanced sensor control, we would sugget you use Argus instead of nvcamerasrc. you can install tegra_multimedia_api via Jetpack to get the sample codes.