Gstreamer imx plugin build error

Hi Community

I am having troubles while adding gstreamer imx plugins to the tdx-reference-multimedia image. I just want to use ‘imxv4l2videosrc’ but it does not exist in the tdx reference multimedia image.

The target is Colibri iMX6
BSP is 6.4.0

When I try to manually build the gstreamer imx plugin.
I am getting this issue.

ERROR: Nothing RPROVIDES ‘gstreamer1.0-plugins-imx’ (but /home/ubuntu/roby/imx6/build/…/layers/meta-myos/recipes-core/images/myos-image.bb RDEPENDS on or otherwise requires it)
gstreamer1.0-plugins-imx was skipped: incompatible with machine colibri-imx6 (not in COMPATIBLE_MACHINE)

Is there any ways to build it and include it to the image?
I was able to use and build this plugin on BSP 2.8 but currently I am not able to use. I guess there is some tricks in image’s recipe or local.conf.

Have you added COMPATIBLE_MACHINE_colibri-imx6 = “colibri-imx6” in recipe or local.conf?

Hi,

yoctouser@4e3421e60980:/yocto/build$ tail conf/local.conf 
PREFERRED_VERSION_gstreamer1.0 = "1.12.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-base = "1.12.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.12.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.12.imx"

# LCD overlay
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT                  = "colibri-imx6_panel-7inch-lvds_overlay.dtbo"
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT:use-mainline-bsp = "colibri-imx6_panel-7inch-lvds_overlay.dtbo"

COMPATIBLE_MACHINE_colibri-imx6 = "colibri-imx6"
yoctouser@4e3421e60980:/yocto/build$ bitbake gstreamer1.0-plugins-imx
Loading cache: 100% |                                                                                                                                                                | ETA:  --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |###############################################################################################################################################################| Time: 0:01:08
Parsing of 3074 .bb files complete (0 cached, 3074 parsed). 4557 targets, 260 skipped, 0 masked, 0 errors.
WARNING: No recipes in default available for:
  /yocto/build/../layers/meta-toradex-nxp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bbappend
ERROR: Nothing PROVIDES 'gstreamer1.0-plugins-imx'
gstreamer1.0-plugins-imx was skipped: incompatible with machine colibri-imx6 (not in COMPATIBLE_MACHINE)

Summary: There was 1 WARNING message.
Summary: There was 1 ERROR message, returning a non-zero exit code.
yoctouser@4e3421e60980:/yocto/build$ stat /yocto/layers/meta-toradex-nxp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bbappend 
  File: /yocto/layers/meta-toradex-nxp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bbappend
  Size: 139             Blocks: 8          IO Block: 4096   regular file
Device: 813h/2067d      Inode: 4075670     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/yoctouser)   Gid: ( 1000/yoctouser)
Access: 2024-04-28 18:59:57.794633652 +0000
Modify: 2024-02-17 21:11:08.357203979 +0000
Change: 2024-02-17 21:11:08.357203979 +0000
 Birth: 2024-02-17 21:11:08.357203979 +0000

Same.

Hello @laura.foster.whv,

Our BSP 6 uses upstream linux kernel and the Gstreamer plugin imxv4l2videosrc does not work with it. This is the reason why it gives you that error message when building the image. However, on BSP 6 for tdx-reference-multimedia image you should already have the video4linux2 plugin (V4L2) supporting real-time video capture on Linux systems. V4L2 provides a standard interface for video devices like webcams, analog TV, digital TV, and other types of video input devices. Let us know if V4L2 suffices your needs.

Hi @rudhi.tx
My curiosity is, using imxv4l2videosrc and imxvpuenc_h264 was give me an option for using hardware VPU. So on my application, I need to encode the source in realtime and using the h264 asic block. As far as I know on the bsp2.8 the v4l2 plugins was encoding the videosource just doing a software encoding. And the most effective result came with gst imx plugin. Thats why I want to migrate my BSP to 6.x but h264 encoding performance should be same. If you have could you please send me some test results, or gstreamer pipelines?

Hello @laura.foster.whv,

You are right, v4l2 plugins use software encoding. If you want to do hardware encoding, you could use v4l2h264enc plugin available on the upstream kernel of BSP 6.4.0.
Here (please take a look at the pipeline for imx8x) you will find an example for the Gstreamer pipeline using v4l2h264enc for sending an encoded RTP video stream. You will have to adapt it to your use-case. Please let me know if that helps.