Freescale / gstreamer-imx

GStreamer 1.0 plugins for i.MX platforms
Other
182 stars 127 forks source link

Does imx8qm can decode video in RGB/BGR format? #286

Closed korabelnikov closed 3 years ago

korabelnikov commented 3 years ago

I have IP-camera that output h264 stream connected to IMX8 quad max

And I'm doing a computer vision but I found out that Gstreamer's plugin 'imxvideoconvert' can't convert videostream to 3-Byte format (acceptable by neural nets).

Currently I can recieve RGBA and convert it to RGB. If I do it myself in code it will spend up to 100% of CPU core time. It leaves no space for other computations.

gst-inspect-1.0 -a |grep imxvideoconvert shows that outputs colors may be 2-byte or 4-byte only.

I've briefly read https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf but I could find any relative info there.

What is fastest way to get raw video in BGR/RGB format?

https://community.nxp.com/t5/i-MX-Processors/Does-imx8qm-can-decode-video-in-RGB-BGR-format/m-p/1193336/highlight/false#M165940

dv1 commented 3 years ago

The QuadMax does not use a Hantro codec. It uses an Amphion one. From what I gather, it cannot decode to RGB/BGR, only to YUV formats. However, the DPU on the QuadMax can be used to convert to RGB/BGR. That functionality is exposed as a v4l2convert element. Closing this now. Feel free to reopen is something is still unclear.