YUY2 to BGRx failure

Using a YUY2 camera and trying to convert to BGR using a pipeline I have tested for other format conversions and it works just fine. For this example it fails.

gst-launch-1.0 -v v4l2src device="/dev/video$CAMERA_NAME" ! 'video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2 , framerate=60/1' ! videorate ! 'video/x-raw, framerate=(fraction)20/1' ! nvvidconv ! 'video/x-raw, format=(string)BGRx' ! videoconvert ! 'video/x-raw, format=(string)BGR' ! queue ! shmsink wait-for-connection=0 socket-path="/tmp/cam$SHARED_MEM_ID" shm-size=200000000 sync=false

If I leave out the nvvidconv part it works but there is lag as the conversion is not using the hardware support. It is unclear to me why the YUY2 to BGRx part is failing as the conversion seems to be supported in the docs by nvvidconv.

My NX Jetpack is as follows:
R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t186ref, EABI: aarch64, DATE: Fri Oct 16 19:37:08 UTC 2020

gstreamer version is:
gst-launch-1.0 version 1.14.5
GStreamer 1.14.5

The nvvidconv plugin supports the two kinds of conversions:

1. ... ! video/x-raw ! nvvidconv ! video/x-raw(memory:NVMM) ! ...
2. ... ! video/x-raw(memory:NVMM) ! nvvidconv ! video/x-raw ! ...

This case is not supported:

... ! video/x-raw ! nvvidconv ! video/x-raw ! ...

You may try this:

... ! video/x-raw ! nvvidconv ! video/x-raw(memory:NVMM) ! nvvidconv ! video/x-raw ! ...

However, it copies CPU buffers to NVMM buffers and then copy back to CPU buffers. Not sure if this brings performance improvement than using videoconvert plugin directly.

1 Like

Thanks. This is a lot more performant than the videoconvert solution even with the copy to NVMM.

1 Like