GStreamer 1.24 Python blacklisted

I am trying to use GStreamer 1.24 with its Python bindings. I use a similar setup for 1.22, but with this version libgstpython.so is blacklisted. It’s in the same location as the other plugins, has the same architecture. I’ve tried with different Python version, to the same end. Any help would be much appreciated!

FROM ubuntu:24.04

# Install Python
ARG PYTHON_VERSION=3.9.18
WORKDIR /opt
RUN apt update -y && apt upgrade -y && \
    apt install -y libbz2-dev libsqlite3-dev zlib1g-dev libffi-dev wget curl build-essential libssl-dev openssl vim && \
    wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
    tar xzvf Python-${PYTHON_VERSION}.tgz && \
    cd Python-${PYTHON_VERSION} && \
    ./configure --enable-shared && \
    make && \
    make install && \
    ln -s /usr/local/bin/python3 /usr/bin/python && \
    ln -s /usr/local/bin/pip3 /usr/bin/pip

# # Install FFmpeg, GStreamer, and reqs for custom plugins
RUN apt update && apt upgrade -y && apt install -y \
    ffmpeg \
    libgstreamer1.0-dev \
    libgstreamer-plugins-base1.0-dev \
    libgstreamer-plugins-bad1.0-dev \
    libhdf5-dev \
    gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-base-apps \
    gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-ugly \
    gstreamer1.0-libav \
    gstreamer1.0-tools \
    gstreamer1.0-x \
    gstreamer1.0-alsa \
    gstreamer1.0-gl \
    gstreamer1.0-gtk3 \
    gstreamer1.0-qt5 \
    gstreamer1.0-pulseaudio \
    graphviz \
    python3-gi \
    python3-gst-1.0 \
    libgirepository1.0-dev \
    cmake \
    python-gi-dev \
    libcairo2-dev \
    ninja-build \
    git \
    flex \
    bison

WORKDIR /opt
RUN pip install pycairo pygobject meson pipenv
RUN GSTREAMER_VERSION=$(gst-launch-1.0 --version | grep version | tr -s ' ' '\n' | tail -1) \
    && wget https://gstreamer.freedesktop.org/src/gst-python/gst-python-$GSTREAMER_VERSION.tar.xz --no-check-certificate \
    && tar -xJf gst-python-$GSTREAMER_VERSION.tar.xz \
    && rm gst-python-$GSTREAMER_VERSION.tar.xz \
    && cd gst-python-$GSTREAMER_VERSION \
    && PREFIX=$(dirname $(dirname $(which python))) \
    && meson build --prefix=$PREFIX \
    && ninja -C build \
    && ninja -C build install \
    && mv $(dirname $(find /usr -name "libgstpython.so")) /usr/local/lib

# Install other dependencies
ENV GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0

Moved from this issue.

The same thing happens when installing apt install gstreamer1.0-python3-plugin-loader rather than building the python bindings from source.

The logs you posted from there only show the fact that the plugin as loaded from the registry has been blacklisted, you would need logs from a run with no registry :slight_smile:

Running GST_DEBUG=4 gst-inspect-1.0 libgstpython.so after clearing the cache is in this gist. The full output was too long to include in the post, but the line that stood out to me is 492:

** (gst-plugin-scanner:15): CRITICAL **: 18:14:35.880: gi.repository.Gst is no dict

Thanks for pointing that out. It turns out that the issue is not 1.24-specific. This discussion provides some hints, and setting PYTHONPATH=/usr/lib/python3.9/site-packages/ seems to resolve the issue.

cc @thiblahute , does that ring a bell?