Imxipuvideotransform displays black video in BGR format

Hi,

I followed this guide to setup my iMX6D with opencv 3.1 with a linux 2.7 image.

I’m trying to read the video stream from the CSI camera module using opencv for an image processing application. I can capture the stream successfully using:

imxv4l2videosrc device=/dev/video1 ! videoconvert ! video/x-raw, format=BGR ! appsink

But the effective FPS is only 12 at 680x480, which is too low for my application.


I noticed that the imx has a hardware accelerated gstreamer element (imxipuvideotransform). When I switched over to this element:

imxv4l2videosrc device=/dev/video1 ! imxipuvideotransform ! video/x-raw, format=BGR ! appsink

The resulting video was black. The pipeline outputs empty frames



I performed some tests using gst-launcher-1.0 with the following results:

gst-launcher-1.0 imxv4l2videosrc device=/dev/video1 ! imxipuvideotransform ! video/x-raw, format=BGR ! imxipuvideosink

The resulting display is half brown as can be seen attached [upload|hvL4/NiQ4RHgTxZWPVZIU25xdF8=]



gst-launcher-1.0 imxv4l2videosrc device=/dev/video1 ! imxipuvideotransform ! video/x-raw, format=BGRA ! imxipuvideosink

The resulting display looks normal as can be seen attached [upload|N8tbFMPfyKYEAPuOQRvgd0TX2AA=]



gst-launcher-1.0 imxv4l2videosrc device=/dev/video1 ! imxipuvideotransform ! video/x-raw, format=BGR ! imxeglvivsink

The resulting display is black as can be seen attached [upload|dKfs1Bp4RO7DkS+QFPXu2g8LM3Y=]



gst-launcher-1.0 imxv4l2videosrc device=/dev/video1 ! imxipuvideotransform ! video/x-raw, format=BGRA ! imxeglvivsink

The resulting display looks normal as can be seen attached [upload|ot2gRU375SHBkHhBRSd7mcm+Ko8=]

hi mashah

Welcome to Toradex Community.

Are you using the official bsp from Toradex or did you compile it yourself? What is exactly your issue?

I compiled the v2.7 image provided by Toradex with opencv 3.1 support using this guide. My issue is that when I open a video stream in opencv with colorspace conversion done through the IPU, the frames are empty resulting in a black video

Using BGRA seems to work fine then? Is there any downside/issue with using BGRA?

The plugins are from the gstreamer-imx project. The FAQ entry I get an “unsupported format BGR” error with imxg2dvideosink might apply also to imxeglvivsink? Is there an error message displayed? Toradex itself is not very experienced in GStreamer plug-in development, so we probably are not able to fix the issue. Maybe opening an issue in the Github project might be helpful. Make sure to also test with the lastest version.

https://github.com/Freescale/gstreamer-imx/blob/master/docs/faq.md#i-get-an-unsupported-format-bgr-error-with-imxg2dvideosink

Hi,

I am not able to use BGRA because opencv only accepts BGR format.
Can you also point me to how I can get the linux headers?

Hi,

I am not able to use BGRA because opencv only accepts BGR format.
Are you sure?

Can you also point me to how I can get the linux headers?
For getting the linux headers, check this community post.