I am trying to build Dockerfile for Deepstream 6.2 with Python and for starters to run a sample app with my own video.
• Hardware Platform (Jetson / GPU) - GPU
• DeepStream Version - Deepstream 6.2
• Issue Type( questions, new requirements, bugs) After building the Dockerfile and trying to run the docker image I get an error that when trying to import cv2:
File “deepstream_imagedata-multistream.py”, line 38, in
import cv2
ImportError: libavcodec.so.58: cannot open shared object file: No such file or directory
If I add just the libavcodec58 installation into my Dockerfile I then receive that libavutil.so.56 is missing and so on. Below in my Dockerfile you can see all the installations I tried, but the missing files kept occurring and I don’t think that’s how it should be. At first I had problem with Python bindings, but I found someone’s else Dockerfile with Python bindings compilation and it seems to work.
• How to reproduce the issue ? I created a project folder with /NVIDIA-AI-IOT/deepstream_python_apps some repo files. Like deepstream_imagedata_multistream.py, the common folder, my own test.mp4 video and Dockerfile. The Dockerfile looks like this:
FROM nvcr.io/nvidia/deepstream:6.2-devel
RUN apt-get update -y
RUN apt-get install cmake -y
RUN apt-get update && apt-get install -y \
python3-gi python3-dev python3-gst-1.0 \
python3-opencv python3-numpy python3-pip\
libgstreamer1.0-0 \
gstreamer1.0-tools \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
libjansson4 \
libavcodec-dev libavformat-dev libswscale-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer1.0-dev \
json-glib-1.0 \
libjson-glib-dev\
libgstrtspserver-1.0-0 gstreamer1.0-rtsp \
libgirepository1.0-dev \
gobject-introspection \
gir1.2-gst-rtsp-server-1.0 \
libgtk-3-dev \
&& apt install libavcodec58 libavutil56 libvpx6 libx264-dev --reinstall
# Compile Python bindings
RUN apt install 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 -y
RUN cd /opt/nvidia/deepstream/deepstream/sources/ \
&& git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git \
&& cd deepstream_python_apps \
&& git submodule update --init \
&& apt-get install -y apt-transport-https ca-certificates -y \
&& update-ca-certificates \
&& cd 3rdparty/gst-python/ \
&& ./autogen.sh \
&& make \
&& make install \
&& cd ../../bindings \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& pip3 install ./pyds-*.whl
WORKDIR /opt/nvidia/deepstream/deepstream-6.2/app/
COPY . .
# Set environment variable
ENV PYTHONPATH=/opt/nvidia/deepstream/deepstream-6.2/sources/:$PYTHONPATH
# Expose port for RTSP streaming
EXPOSE 8554
# Start the application
CMD ["python3", "deepstream_imagedata-multistream.py", "test.mp4"]
Maybe I am missing something?