X264enc plugin is not available from within my docker container

• Hardware Platform (Jetson / GPU): Jetson Orin Nano
• DeepStream Version: [Your DeepStream Version]
• JetPack Version (valid for Jetson only): [Your JetPack Version]
• TensorRT Version: [Your TensorRT Version]
• NVIDIA GPU Driver Version (valid for GPU only): [If applicable, your GPU Driver Version]
• Issue Type (questions, new requirements, bugs): questions
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing):
- I am facing an issue where the GStreamer plugin x264enc is not available in my DeepStream Docker container.
- The plugin is available and works on my Jetson Orin Nano host machine. When I inspect it on the host using gst-inspect-1.0 x264enc, I can see it’s installed and the file is located at /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstx264.so.
- However, when running my DeepStream application inside a Docker container, gst-inspect-1.0 x264enc reports that the plugin is not found.
- The Docker container is built using the DeepStream image nvcr.io/nvidia/deepstream:6.3-triton-multiarch.
- Here is a snippet of my Dockerfile where I attempt to install the necessary GStreamer plugins:
RUN apt-get update && apt-get install -y \ libx264-dev \ gstreamer1.0-plugins-ugly \ && rm -rf /var/lib/apt/lists/*
• Requirement details (This is for new requirement. Including the module name-for which plugin or for which sample application, the function description):
- I need to use the x264enc plugin for video encoding in my DeepStream application running inside a Docker container on a Jetson Orin Nano. The plugin works on the host machine, but it’s not available in the Docker environment. I am looking for guidance on how to make this plugin available and functional within my Dockerized DeepStream application.

This is caused by legal issues.Some packages were removed during the image build process.
Just follow the steps below.

RUN apt-get update && apt-get install --reinstall -y \
    libx264-dev libx264-155 \ 
    gstreamer1.0-plugins-ugly

Should I rebuild the image or can I just run this command “apt-get update && apt-get install --reinstall -y libx264-dev libx264-155 gstreamer1.0-plugins-ugly” inside a interactive shell from within the docker container.

When I run this command inside of the shell “apt-get update && apt-get install --reinstall -y libx264-dev libx264-155 gstreamer1.0-plugins-ugly” then I still get this message when I run this command:
Command = “gst-inspect-1.0 x264enc”

Message that I receive back:
No such element or plugin ‘x264enc’

I have tried two operations, both are OK.

First try rm -rf ~/.cache/gstreamer-1.0/ in the docker shell.

If it does not work, it is recommended to rebuild the image.

Even after doing this it is still not working. Here is what my Dockerfile looks like:

#FROM nvcr.io/nvidia/deepstream-l4t:6.3-samples
FROM nvcr.io/nvidia/deepstream:6.3-triton-multiarch
ENV NVIDIA_DRIVER_CAPABILITIES $NVIDIA_DRIVER_CAPABILITIES,video
ENV LOGLEVEL=“INFO”
ENV GST_DEBUG=2
ENV GST_DEBUG_FILE=/app/output/GST_DEBUG.log

RUN apt update
RUN apt install -y python3-gi python3-dev python3-gst-1.0 python3-numpy python3-opencv

RUN apt install -y libssl1.1 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev

RUN apt-get update && apt-get install -y
gstreamer1.0-plugins-base
gstreamer1.0-plugins-good
gstreamer1.0-plugins-bad
gstreamer1.0-plugins-ugly
gstreamer1.0-tools \

RUN apt-get update && apt-get install -y
libmpg123-0
libavcodec-extra
libx265-dev
libde265-dev
mpeg2dec
gstreamer1.0-plugins-ugly
gstreamer1.0-plugins-bad
gstreamer1.0-plugins-good
gstreamer1.0-plugins-base
&& rm -rf /var/lib/apt/lists/*

RUN apt install -y git
WORKDIR /opt/nvidia/deepstream/deepstream/lib/
COPY libnvbufsurface.so /opt/nvidia/deepstream/deepstream/lib/libnvbufsurface.so
COPY libnvbufsurftransform.so /opt/nvidia/deepstream/deepstream/lib/libnvbufsurftransform.so

RUN apt install -y python3-gi python3-dev python3-gst-1.0 python-gi-dev git python-dev
python3 python3-pip python3.8-dev cmake g++ build-essential libglib2.0-dev
libglib2.0-dev-bin libgstreamer1.0-dev libtool m4 autoconf automake libgirepository1.0-dev libcairo2-dev nano
WORKDIR /opt/nvidia/deepstream/deepstream-6.3/sources/
RUN git clone GitHub - NVIDIA-AI-IOT/deepstream_python_apps: DeepStream SDK Python bindings and sample applications
WORKDIR /opt/nvidia/deepstream/deepstream-6.3/sources/deepstream_python_apps/

RUN git submodule update --init
RUN apt-get install -y apt-transport-https ca-certificates
RUN update-ca-certificates
WORKDIR 3rdparty/gst-python/
RUN ./autogen.sh
RUN make
RUN make install
WORKDIR /opt/nvidia/deepstream/deepstream-6.3/sources/deepstream_python_apps/bindings/build/

#COPY ./tegra /opt/nvidia/deepstream/deepstream/
RUN cmake … -DPYTHON_MAJOR_VERSION=3 -DPYTHON_MINOR_VERSION=8 -DPIP_PLATFORM=linux_aarch64 -DDS_PATH=/opt/nvidia/deepstream/deepstream
RUN make

RUN pip install ./pyds-1.1.8-py3-none*.whl

RUN apt-get install -y libgstrtspserver-1.0-0 gstreamer1.0-rtsp libgirepository1.0-dev gobject-introspection gir1.2-gst-rtsp-server-1.0

WORKDIR /smartpole

COPY . /smartpole

RUN pip install -r requirements.txt

I then build the image and then I run the docker container with this command:

docker run -itd --runtime nvidia -e NVIDIA_VISIBLE_DEVICES=all --network=“host” --name deepstream-container -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix deepstream-image

Then I enter into the container with this command:

docker exec -it deepstream-container /bin/bash

Do you see any reason for why I am unable to use the x264enc plugin from within the deepstream container?

As I said above, some shared libraries were removed from the docker image due to copyright issues.

Please add the --reinstall parameter

"apt-get install –reinstall -y "

I have tried this, and even rebuilt the image with this command, but I am still unable to use that plugin

If you just want to build an image that pyds can run normally, here is the simplest way.

FROM nvcr.io/nvidia/deepstream:6.3-triton-multiarch

RUN /opt/nvidia/deepstream/deepstream/user_additional_install.sh

RUN rm -rf ~/.cache/gstreamer-1.0/

RUN apt install -y python3-gi python3-dev python3-gst-1.0 python-gi-dev git python3 python3-pip python3.8-dev cmake g++ build-essential libglib2.0-dev libglib2.0-dev-bin libgstreamer1.0-dev libtool m4 autoconf automake libgirepository1.0-dev libcairo2-dev

RUN wget https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases/download/v1.1.8/pyds-1.1.8-py3-none-linux_aarch64.whl && \
    pip3 install ./pyds-1.1.8-py3-none-linux_x86_64.whl


# Add custom layer here
# WORKDIR /smartpole

# COPY . /smartpole

# RUN pip install -r requirements.txt

Save the above content as Dockerfile, Then run the following command.

docker build -f Dockerfile  -t pyds-jetson . --no-cache

Installing gstreamer-* over and over again in the Dockerfile is unnecessary.
Please first ensure that Jetpack is correctly installed in the Host.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.