I'm trying to use GStreamer from docker container, built using this Dockerfile.
The installation worked ok and I'm able to run GStreamer. However, I'm not able to use the element v4l2h264enc
with the error that does not exist. When I run gst-inspect I get:
root@95e1ff54cca5:~# gst-inspect-1.0 v4l2h264enc
No such element or plugin 'v4l2h264enc'
But v4l2src
works fine:
root@95e1ff54cca5:~# gst-inspect-1.0 v4l2src
Factory Details:
Rank primary (256)
Long-name Video (video4linux2) Source
Klass Source/Video
Description Reads frames from a Video4Linux2 device
Author Edgard Lima <[email protected]>, Stefan Kost <[email protected]>
Plugin Details:
Name video4linux2
Description elements for Video 4 Linux
Filename /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstvideo4linux2.so
Version 1.18.0
License LGPL
Source module gst-plugins-good
Source release date 2020-09-08
Binary package GStreamer Good Plug-ins source release
Origin URL Unknown package origin
I have checked in the build
folder of gst-plugins-good
and I think that v4l2h265enc
library was compiled (there's a file named gstv4l2h265enc.c.o
). I tried to add the folder where the file is to LD_LIBRARY_PATH
and GST_PLUGIN_PATH
but it didn't work.
I had the same problem with on a raspberrypi 4 with gstreamer and solved it by enabling the kernel side support (often referenced as "v4l2m2m").
You can check it is activated because you get new /dev/video character device files in addition to /dev/video0. (for me it's 3 new files /dev/video[10,11,12]).
Check that the kernel module is loaded or load it with:
Then
gst-inspect-1.0 video4linux2
should show you the elements you are looking for, such as v4l2h264dec, v4l2h264enc, v4l2vp8dec, .... (sometimes gst-inspect-1.0 does not really retry but relies on a cache which might not reflect recent changes: removing the cache can be helpful. In my install I dorm ~/.cache/gstreamer-1.0/registry.armv8-a.bin
)