Video4linux2: v4l2h264enc missing from gst-inspect

$ gst-inspect-1.0 --plugin video4linux2
Plugin Details:
  Name                     video4linux2
  Description              elements for Video 4 Linux
  Filename                 /usr/lib64/gstreamer-1.0/libgstvideo4linux2.so
  Version                  1.22.3
  License                  LGPL
  Source module            gst-plugins-good
  Documentation            https://gstreamer.freedesktop.org/documentation/video4linux2/
  Source release date      2023-05-19
  Binary package           Gentoo GStreamer ebuild
  Origin URL               https://www.gentoo.org

  v4l2deviceprovider: Video (video4linux2) Device Provider
  v4l2radio: Radio (video4linux2) Tuner
  v4l2sink: Video (video4linux2) Sink
  v4l2src: Video (video4linux2) Source

  4 features:
  +-- 3 elements
  +-- 1 device providers

Well, that’s what I get on my RPi5. It is also pretty much what I get on my AMD64 system.

What I’m expecting is a couple of additional “features” or “elements,” not sure what the right terminology is, but I was hoping for (additionally):

v4l2h264enc
v4l2convert

Please excuse my lack of experience in this area, I am simply trying to get a streaming webcam from out of my RPi5, and came across numerous “pipelines” (again, excuse if wrong word) for a stream:

$ gst-launch-1.0 v4l2src ! v4l2h264enc ! fakesink
WARNING: erroneous pipeline: no element "v4l2h264enc"
$ gst-launch-1.0 v4l2src ! v4l2convert ! fakesink
WARNING: erroneous pipeline: no element "v4l2convert"

These are just extremely simplified streams from various examples floating around the internet that are just designed to demonstrate my issue: that I have no such elements.

I’ve seen many posts complaining of the same thing, and the solution is always to use another element outside of v4l2*, and there is no explanation ever given for why some people seem to have these elements and some people don’t.

So I’m just trying to understand why it is missing from my system, though they are present in the plugin library, at least by name, and I did build gst-plugins-good from source, and support appears present and compiled-in:

$ strings /usr/lib64/gstreamer-1.0/libgstvideo4linux2.so | grep -e v4l2h264enc -e v4l2convert | sort -u
v4l2convert
v4l2h264enc

I believe I have all of the proper kernel modules built/loaded, etc.

Could somebody please mention if/when/why the v4l2h264enc and v4l2convert elements are supposed to be present, what they represent, and how they relate to the h/w of the camera? Maybe if the camera h/w doesn’t support h264 then it won’t be there? And if that is the case, how would I discover what the camera does support?

Note that my system does not have a /de/v4l2 directory either, but it does have a /dev/v4l one. Not sure if this is a udev problem or some other configuration issue, or just my system isn’t expected to have one because of some lack of support or need for one.

Again, sorry for being such a newb…but this camera stack stuff is quite the sub-system. Thanks for any knowledge…BTW, when I run gst-inspect… with debugging turned on to the max, the missing features are not even attempted to be loaded…claims there are only 4 features total (as listed at the top), though again, the library seems to contain references to more than just those four.

I can’t help, but rather coincidentally I’m getting the same thing. My issue is that my video device is /dev/video2, but during the probing step this video device isn’t found and therefore the plugins aren’t being registered…


#ifdef GST_V4L2_ENABLE_PROBE
  ret |= gst_v4l2_probe_and_register (plugin);
#endif

  ret |= GST_ELEMENT_REGISTER (v4l2src, plugin);
  ret |= GST_ELEMENT_REGISTER (v4l2sink, plugin);
  ret |= GST_ELEMENT_REGISTER (v4l2radio, plugin);
  ret |= GST_DEVICE_PROVIDER_REGISTER (v4l2deviceprovider, plugin);
0:00:00.945327008  5010 0xaaaac126c400 DEBUG                   v4l2 gstv4l2.c:114:gst_v4l2_probe_and_register: Probing devices
0:00:00.949155914  5010 0xaaaac126c400 DEBUG                   v4l2 gstv4l2.c:135:gst_v4l2_probe_and_register: Failed to get device capabilities: Inappropriate ioctl for device
0:00:00.955557382  5010 0xaaaac126c400 DEBUG                   v4l2 gstv4l2.c:128:gst_v4l2_probe_and_register: Failed to open /dev/video0: Device or resource busy
0:00:00.956022370  5010 0xaaaac126c400 DEBUG                   v4l2 gstv4l2.c:128:gst_v4l2_probe_and_register: Failed to open /dev/video1: Device or resource busy
0:00:00.956323363  5010 0xaaaac126c400 DEBUG       GST_ELEMENT_PADS gstelement.c:315:gst_element_base_class_init: type GstV4l2Src : factory 0xaaaac17c4b90

Okay for me it’s because of this line

My device isn’t a M2M device and so the plugin never gets loaded.

Thanks for pointing out that code. Seems then that no other elements are being registered at this time. In fact, it looks like there is nothing else being registered because the rest is a work-in-progress, including h264. Unless there is something else going on, there’s this in sys/v4l2/gstv4l2h264enc.c

static void
gst_v4l2_h264_enc_set_property (GObject * object,
    guint prop_id, const GValue * value, GParamSpec * pspec)
{
  /* TODO */
}

static void
gst_v4l2_h264_enc_get_property (GObject * object,
    guint prop_id, GValue * value, GParamSpec * pspec)
{
  /* TODO */
}

static void
gst_v4l2_h264_enc_init (GstV4l2H264Enc * self)
{
}

Unless somebody can show to the contrary, it looks like h264 is just no longer enabled in gstv4l2…anybody else get that same impression?