Missing library files for libavcodec58 packages in nvcr.io/nvidia/deepstream-l4t:6.2-triton container

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
Jetson Orin 32GB Developer Kit
• DeepStream Version
NGC DeepStream-l4t nvcr.io/nvidia/deepstream-l4t:6.2-triton
• JetPack Version (valid for Jetson only)
JetPack 5.1.1
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
bugs
• 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)
【Reproduction Steps】
1. Launch docker container.

sudo docker run --runtime nvidia --rm -it nvcr.io/nvidia/deepstream-l4t:6.2-triton

2. Check apt installed library

apt list --installed | grep libav

We note here that libavcodec58 is installed.

3. Check .so file

ls -l /usr/lib/aarch64-linux-gnu/libav*

For libavcodec58, libavcodec.so.58.54.100 should exist, but does not.

This is the initial state of the container.

【What is the problem?】
Anything that requires this library, e.g. opencv, will result in an error.

4. install libavcodec-dev
If I install libavcodec-dev, symbolic links to non-existent files will be created.

apt install -y libavcodec-dev
ls -l /usr/lib/aarch64-linux-gnu/libav*

5. install opencv

apt-get install -y --no-install-recommends \
      libopencv \
      libopencv-dev \
      libopencv-python \
      libopencv-samples \
      opencv-licenses

6. python import cv2

python3 -c "import cv2"

Error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.8/dist-packages/cv2/__init__.py", line 180, in <module>
    bootstrap()
  File "/usr/lib/python3.8/dist-packages/cv2/__init__.py", line 152, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libavcodec.so.58: cannot open shared object file: No such file or directory

【Solution】
Uninstall the problematic apt packages and reinstall them.

7. Uninstall

apt remove -y libavcodec58 libavutil56
apt install -y libavcodec-dev
apt list --installed | grep libav
ls -l /usr/lib/aarch64-linux-gnu/libav*

8. libvpx6
To import opencv in python, libvpx6 must also be modified.

apt remove -y libvpx6
apt install -y libvpx6

9. install opencv

apt-get install -y --no-install-recommends \
      libopencv \
      libopencv-dev \
      libopencv-python \
      libopencv-samples \
      opencv-licenses

10. python import cv2
import cv2 can now be executed without error.

python3 -c "import cv2"

【Why does this problem occur?】
I wanted to use opencv built for L4T.
Is this a specific problem that occurs with the combination of JetPack 5.1.1 and nvcr.io/nvidia/deepstream-l4t:6.2-triton (which should be for JetPack 5.1)?
Or is the problem occurring on the container side?

This problem did not occur with JetPack 4.6.1 and nvcr.io/nvidia/deepstream-l4t:6.0.1-triton.
It was fun because it is a rare problem.

You can try to run the /opt/nvidia/deepstream/deepstream-6.2/user_deepstream_python_apps_install.sh first.

1 Like

Thank you very much.
I checked this script and I understand which libraries need to be re-installed in the container.

apt-get install --reinstall -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libavresample-dev libavresample4 libavutil-dev libavutil56 libavcodec-dev libavcodec58 libavformat-dev libavformat58 libavfilter7 libde265-dev libde265-0 libx265-179 libvpx6 libmpeg2encpp-2.1-0 libmpeg2-4 libmpg123-0

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