Avdec_h264 is not found after installing gst-libav

running a docker image FROM ubuntu:22.04

  • installing dependencies
    apt-get install -y build-essential cmake ninja-build git python3 python3-pip pkg-config flex bison libnice-dev nasm libsrtp2-dev gsoap libgsoap-dev libmicrohttpd-dev libconfig-dev libspdlog-dev libusrsctp-dev protobuf-compiler libprotobuf-dev libpciaccess-dev libssl-dev libboost-all-dev rapidjson-dev wget librabbitmq-dev gdb libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev ffmpeg

  • cloning gstreamer 1.22

  • built using the following flags
    meson setup -Dauto_features=disabled -Dpython=disabled -Dlibav=enabled -Dlibnice=enabled -Dbase=enabled -Dgood=enabled -Dugly=disabled -Dbad=enabled -Ddevtools=disabled -Drtsp_server=disabled -Dgst-examples=disabled -Dqt5=disabled -Dtools=enabled -Dtests=disabled -Dexamples=disabled -Dintrospection=disabled -Dnls=disabled -Ddoc=disabled -Dgstreamer:ptp-helper-permissions=none -Dlibnice:gupnp=auto -Dlibnice:gstreamer=enabled -Dlibnice:crypto-library=auto -Dgst-plugins-base:playback=enabled -Dgst-plugins-base:typefind=enabled -Dgst-plugins-base:app=enabled -Dgst-plugins-base:videoconvertscale=enabled -Dgst-plugins-good:rtsp=enabled -Dgst-plugins-good:rtpmanager=enabled -Dgst-plugins-good:autodetect=enabled -Dgst-plugins-good:udp=enabled -Dgst-plugins-good:rtp=enabled -Dgst-plugins-good:debugutils=enabled -Dgst-plugins-good:multifile=enabled -Dgst-plugins-good:isomp4=enabled -Dgst-plugins-bad:webrtc=enabled -Dgst-plugins-bad:codectimestamper=enabled -Dgst-plugins-bad:videoparsers=enabled -Dgst-plugins-bad:dtls=enabled -Dgst-plugins-bad:srtp=enabled -Dgst-plugins-bad:sctp=enabled -Dgst-plugins-bad:debugutils=enabled build

  • after compiling the build I tried to inspect the libgstlibav.so gst-inspect-1.0 ./build/subprojects/gst-libav/ext/libav/libgstlibav.so the following output appeared

Plugin Details:
  Name                     libav
  Description              All libav codecs and formats (system install)
  Filename                 /test/gstreamer/build/subprojects/gst-libav/ext/libav/libgstlibav.so
  License                  LGPL
  Source module            gst-libav
  Documentation            https://gstreamer.freedesktop.org/documentation/libav/
  Binary package           GStreamer FFMPEG Plug-ins git
  Origin URL               Unknown package origin

  avdeinterlace: libav Deinterlace element

  1 features:
  +-- 1 elements
  • I tried to build without any flags using meson setup build but the same output appeared and I can’t find avdec_h264 or the other elements from libav

Did you see anything suspicious in the gst-libav subproject meson configure?

Could you attach your ${builddir}/meson-logs/meson-log.txt file?

I didn’t see anything suspicious, here is the meson-log.txt when using the flags

is there anything wrong in installation logs?

I do not think you can find anything from sub build dir. All dependencies are not available.
gst-inspect-1.0 ./build/subprojects/gst-libav/ext/libav/libgstlibav.so

Try to install your build in /opt/gstreamer. After installation, set proper env variables for gstreamer.

To be honest, I am surprised that something like this is not immediately visible.
It turns out that when meson doesn’t find ffmpeg dependencies installed and findable by cmake/pkgconfig (libavfiler etc.), it will clone it and I think it will build a license-restricted version of it enabling only a single element which is the avdeinterlace.

Installing ffmpeg from apt via apt install ffmpeg libavfilter-dev then building gstreamer with the mentioned commands will enable all the plugins/elements from libgstlibav.so