Issue with FFmpeg Dependencies on DeepStream 7.1 (deepstream:7.1-gc-triton-devel)

• Hardware Platform (Jetson / GPU)

GCP VM with NVIDIA T4 GPU

• DeepStream Version

DeepStream 7.1

• JetPack Version (valid for Jetson only)

N/A

• TensorRT Version

10.3.0.26

• NVIDIA GPU Driver Version (valid for GPU only)

550.90.07

• Issue Type

Bug

• How to reproduce the issue?

I am trying to install FFmpeg dependencies inside the deepstream:7.1-gc-triton-develDocker container, but I am encountering issues where FFmpeg-related libraries seem to be missing or broken, despite installing them via apt.

My Dockerfile (attached below) includes ffmpeg and related dependencies, but when I try to use FFmpeg, it either fails due to missing shared libraries or incorrect package versions. I reinstalled specific FFmpeg-related libraries such as libmp3lame0, libxvidcore4, and libflac8, which fixes the issue, but I’m curious how I can get this working without reinstalling?

I suspect there might be compatibility issues with the base deepstream:7.1-gc-triton-devel image.

• Steps to Reproduce

  1. Build the Docker image using the provided Dockerfile.
  2. Run ffmpeg -version inside the container and observe missing dependencies.
FROM nvcr.io/nvidia/deepstream:7.1-gc-triton-devel

ENV SHELL /bin/bash
ENV CUDA_HOME=/usr/local/cuda
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CUDA_HOME}/lib64
ENV PATH=$PATH:$CUDA_HOME/bin
ENV DEBIAN_FRONTEND=noninteractive

SHELL ["/bin/bash", "-c"]

WORKDIR /root
COPY pip.conf /etc/pip.conf

# Install system dependencies
RUN apt-get update && \
    apt-get install -y \
    clang-format-11 \
    libspdlog-dev \
    ffmpeg \
    libglib2.0-dev \
    libjson-glib-dev \
    uuid-dev \
    libyaml-cpp-dev \
    libprotobuf-dev \
    protobuf-compiler \
    mosquitto \
    python3.10 \
    python3.10-dev \
    python3.10-venv \
    python3.10-dbg \
    gcovr \
    lcov \
    python3-gi \
    python3-gi-cairo \
    libgirepository1.0-dev \
    libxml2 \
    libxml2-dev \
    libxml2-utils \
    libmp3lame0 \
    libxvidcore4 \
    libflac8 \
    && apt clean && rm -rf /var/lib/apt/lists/*

# reinstall corrupted packages for ffmpeg
RUN apt-get update \
    && apt-get install --reinstall -y \
    libmp3lame0 \
    libxvidcore4 \
    libflac8

# Update alternatives to use Python 3.10
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

# Install VPI
RUN apt install gnupg \
    && apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc \
    && apt install -y software-properties-common \
    && add-apt-repository -y 'deb https://repo.download.nvidia.com/jetson/x86_64/focal r34.1 main' \
    && apt update \
    && apt install -y libnvvpi2 vpi2-dev \
    && apt clean \
    && rm -rf /var/lib/apt/lists/*

# install interpipe
RUN apt-get update \
    && apt-get install -y \
        git \
        gtk-doc-tools \
        autoconf \
        automake \
        libtool \
    && mkdir -p /root/tmp \
    && cd /root/tmp \
    && git clone https://github.com/RidgeRun/gst-interpipe/ \
    && cd gst-interpipe \
    && git checkout v1.1.8 \
    && ./autogen.sh --libdir /usr/lib/$(uname -m)-linux-gnu/ \
    && make \
    && make install \
    && rm -rf /root/tmp/ \
    && apt clean \
    && rm -rf /var/lib/apt/lists/*

# Install CMake
ARG CMAKE_VERSION=3.27
ARG CMAKE_BUILD=9
RUN mkdir /root/tmp \
    && cd /root/tmp \
    && apt update \
    && apt install -y wget build-essential \
    && wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.${CMAKE_BUILD}.tar.gz \
    && tar -xzvf cmake-${CMAKE_VERSION}.${CMAKE_BUILD}.tar.gz \
    && cd cmake-${CMAKE_VERSION}.${CMAKE_BUILD} \
    && ./bootstrap \
    && make -j$(nproc) \
    && make install \
    && rm -rf /root/tmp \
    && apt clean \
    && rm -rf /var/lib/apt/lists/*

# Install Python packages
RUN pip3 install --upgrade pip && pip3 install --upgrade numpy==1.24.2

# Build CUDA-enabled OpenCV from source
RUN cd /root \
    && git clone -b 4.10.0 https://github.com/opencv/opencv.git \
    && git clone -b 4.10.0 https://github.com/opencv/opencv_contrib.git \
    && cd opencv \
    && mkdir build \
    && cd build \
    && cmake .. \
        -DCMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D WITH_CUDA=ON \
        -D ENABLE_FAST_MATH=1 \
        -D CUDA_FAST_MATH=1 \
        -D WITH_CUBLAS=1 \
        -D WITH_GSTREAMER=ON \
        -D WITH_LIBV4L=ON \
        -D INSTALL_PYTHON_EXAMPLES=ON \
        -D WITH_FFMPEG=ON \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D BUILD_opencv_python2=OFF \
        -D BUILD_opencv_python3=ON \
        -D OPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules \
        -DOPENCV_PYTHON3_INSTALL_PATH=/usr/lib/python3/dist-packages \
        -DPYTHON_EXECUTABLE=/usr/bin/python3 \
    && make -j$(nproc) \
    && make install \
    && rm -rf /root/opencv \
    rm -rf /root/opencv_contrib
RUN python3 -c "import cv2; print(cv2.getBuildInformation())"

# Install Python testing tools
RUN python3 -m pip uninstall -y importlib-metadata && \
    python3 -m pip install -U argcomplete \
    flake8-blind-except \
    flake8-builtins \
    flake8-class-newline \
    flake8-comprehensions \
    flake8-deprecated \
    flake8-docstrings \
    flake8-import-order \
    flake8-quotes \
    pytest-repeat \
    pytest-rerunfailures \
    pytest

# DeepStream environment setup
RUN . /opt/nvidia/deepstream/deepstream-7.1/user_additional_install.sh \
    && . /opt/nvidia/deepstream/deepstream-7.1/install.sh \
    && cd /opt/nvidia/deepstream/deepstream-7.1 \
    && ldconfig
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/nvidia/deepstream/deepstream-7.1/lib/
ENV GST_PLUGIN_PATH=/opt/nvidia/deepstream/deepstream-7.1/lib/gst-plugins

# Check CUDA and cuDNN versions
RUN nvcc --version && \
    whereis cudnn.h && \
    cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

# Check TensorRT version
RUN dpkg -l | grep nvinfer

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
WORKDIR /root
CMD ["bash"]

There is some issue with the docker. “reinstall” is the solution.

Thank you for your response! I have a quick follow up question. Can you clarify what you mean by that there’s an issue with docker? Is this related to the deepstream 7.1 gc-triton-devel base image?

Yes. E.G. This caused the issue: deepstream_dockers

You can customized correct docker image based on the open source dockerfile.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks