AnsweredAssumed Answered

gstreamer-imx from Yocto

Question asked by Chris Roed on Sep 6, 2018
Latest reply on Sep 6, 2018 by igorpadykov

I've built a linux image using the instructions detailed here https://www.nxp.com/docs/en/user-guide/i.MX_Yocto_Project_User 

 

 

I'm trying to use gstreamer to capture a imxv4l2src and having problems linking it to any sort of sink, even a fakesink.   I'm going to shorten the output here for brevity... but there's a few odd things I noticed... 

 

TL:DR

*opening imxv4l2src tries to open /dev/video[0-31] even if I directly specify /dev/video0

*connecting imxv4l2src to any sink says that the caps are incompatible

*imxv4l2src shows EMPTY capabilities when I run gst-inspect-1.0

*specifying caps (i.e. video/x-raw,format=UYVY) doesn't help this issue because gstreamer still says imxv4l2src caps are incompatible

 

 

Any suggestions on how to fix these problems?

 

Console output (shortened for brevity):

 

root@imx6dl:~# GST_DEBUG=4 gst-launch-1.0 imxv4l2src device=/dev/video0 ! fakesink
0:00:00.170076989 551 0xb83800 INFO GST_INIT gst.c:730:init_post: initialized GStreamer successfully
0:00:00.170356347 551 0xb83800 INFO GST_PIPELINE gstparse.c:334:gst_parse_launch_full: parsing pipeline description 'imxv4l2src device=/dev/video0 ! fakesink '
0:00:00.184005189 551 0xb83800 INFO GST_PLUGIN_LOADING gstplugin.c:843:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstimxv4l2plugins.so" loaded
0:00:00.184338218 551 0xb83800 INFO GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "imxv4l2src"
0:00:00.184834927 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:1112:gst_imx_v4l2_open_device: device name: /dev/video0
0:00:00.231183921 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: YU12
0:00:00.237341785 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: UYVY
0:00:00.245897523 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: YUYV
0:00:00.253866209 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: 422P
0:00:00.262086584 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: RGBP
0:00:00.270373298 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: BGR3
0:00:00.277047873 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: RGB3
0:00:00.286392012 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: BGR4
0:00:00.295253776 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: BA81
0:00:00.304180545 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:767:gst_imx_v4l2_get_caps: frame format: BG10
0:00:00.317022318 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:1112:gst_imx_v4l2_open_device: device name: /dev/video1
0:00:00.317461356 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:1112:gst_imx_v4l2_open_device: device name: /dev/video2
0:00:00.317794718 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:1112:gst_imx_v4l2_open_device: device name: /dev/video3

*** ETC ETC WHY IS GST TRYING TO OPEN VIDEO0-VIDEO31? ***

0:00:00.345605448 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:1112:gst_imx_v4l2_open_device: device name: /dev/video30
0:00:00.345655785 551 0xb83800 INFO imxv4l2 gstimxv4l2.c:1112:gst_imx_v4l2_open_device: device name: /dev/video31
0:00:00.346235169 551 0xb83800 INFO GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseSrc@0xd02108> adding pad 'src'
====== IMXV4L2SRC: 4.3.5 build on Sep 4 2018 19:55:14. ======
0:00:00.355465631 551 0xb83800 INFO GST_PIPELINE grammar.y:652:gst_parse_perform_link: linking some pad of GstImxV4l2Src named imxv4l2src0 to some pad of GstFakeSink named fakesink0 (0/0) with caps "(NULL)"
0:00:00.356265366 551 0xb83800 INFO GST_ELEMENT_PADS gstutils.c:1709:gst_element_link_pads_full: trying to link element imxv4l2src0:(any) to element fakesink0:(any)
0:00:00.356589061 551 0xb83800 INFO GST_PADS gstutils.c:1009:gst_pad_check_link: trying to link imxv4l2src0:src and fakesink0:sink
0:00:00.357233450 551 0xb83800 INFO GST_ELEMENT_PADS gstutils.c:1201:gst_element_get_compatible_pad:<fakesink0> Could not find a compatible pad to link to imxv4l2src0:src
0:00:00.357974513 551 0xb83800 INFO GST_PADS gstutils.c:1009:gst_pad_check_link: trying to link imxv4l2src0:src and fakesink0:sink
0:00:00.358740913 551 0xb83800 INFO GST_ELEMENT_PADS gstutils.c:1201:gst_element_get_compatible_pad:<imxv4l2src0> Could not find a compatible pad to link to fakesink0:sink
0:00:00.359176950 551 0xb83800 INFO default gstutils.c:2098:gst_element_link_pads_filtered: Could not link pads: imxv4l2src0:(null) - fakesink0:(null)
0:00:00.359531648 551 0xb83800 ERROR GST_PIPELINE grammar.y:740:gst_parse_perform_link: could not link imxv4l2src0 to fakesink0
WARNING: erroneous pipeline: could not link imxv4l2src0 to fakesink0

 

 

 

 

root@imx6dl:~# gst-inspect-1.0 imxv4l2src
====== IMXV4L2SRC: 4.3.5 build on Sep 4 2018 19:55:14. ======
Factory Details:
Rank primary + 1 (257)
Long-name IMX Video (video4linux2) Source
Klass Src/Video
Description Capture frames from IMX SoC video4linux2 device
Author Multimedia Team <shmmmw@freescale.com>

Plugin Details:
Name imxv4l2.imx
Description IMX SoC v4l2-based video source/sink
Filename /usr/lib/gstreamer-1.0/libgstimxv4l2plugins.so
Version 4.3.5
License LGPL
Source module imx-gst1.0-plugin
Binary package Freescle Gstreamer Multimedia Plugins
Origin URL http://www.freescale.com

GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstPushSrc
+----GstImxV4l2Src

Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
EMPTY

 

 

 

Compare that with imxv4l2sink

root@imx6dl:~# gst-inspect-1.0 imxv4l2sink
====== IMXV4L2SINK: 4.3.5 build on Sep 4 2018 19:55:14. ======
Factory Details:
Rank primary + 1 (257)
Long-name IMX Video (video4linux2) Sink
Klass Sink/Video
Description Displays frames on IMX SoC video4linux2 device
Author Multimedia Team <shmmmw@freescale.com>

Plugin Details:
Name imxv4l2.imx
Description IMX SoC v4l2-based video source/sink
Filename /usr/lib/gstreamer-1.0/libgstimxv4l2plugins.so
Version 4.3.5
License LGPL
Source module imx-gst1.0-plugin
Binary package Freescle Gstreamer Multimedia Plugins
Origin URL http://www.freescale.com

GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseSink
+----GstVideoSink
+----GstImxV4l2Sink

Implemented Interfaces:
GstVideoOverlay
GstVideoDirection

Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
video/x-raw
format: { (string)I420, (string)NV12, (string)YV12, (string)Y42B, (string)UYVY, (string)YUY2, (string)RGB16, (string)RGBx }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition)
format: { (string)I420, (string)NV12, (string)YV12, (string)Y42B, (string)UYVY, (string)YUY2, (string)RGB16, (string)RGBx }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]

Outcomes