Nvidia Jetson AGX Xavier - What deepstream python apps version to run examples?

Hi, I have just installed Jetson linux 35.6.1 on my Jetson AGX Xavier.
To run the deepstream python examples do I need the newest version or some older?
What about python bindings? What version?
Anything else?
I’m interested in the opticalflow example and possible the newest version of the deepstream examples.

Thank you for the support!

Xavier can only support Jetpack 5.1 and DeepStream 6.3 at most.

You can refer to pyds-1.1.8, the following link is sample code about opticalflow.

Ok, thank you.
I have done all the steps, I see the deepstream app (cpp version is working correctly)
The I have followed python apps steps and I see some problem like below:
"
File deepstream_test_1.py, line 201, in main
pgie.set_property(‘config-file-path’, “dstest1_pgie_config.txt”)
AttributeError: ‘NoneType’ object has no attribute ‘set_property’
"
In case of opticalflow there is the same error but related to encoder.

I have seen similar problem:

But the above did not fix it for me

Please install deepstream python binding (pyds) correctly

sudo apt install python3-gi python3-dev python3-gst-1.0 python-gi-dev git meson \
    python3 python3-pip python3.10-dev cmake g++ build-essential libglib2.0-dev \
    libglib2.0-dev-bin libgstreamer1.0-dev libtool m4 autoconf automake libgirepository1.0-dev libcairo2-dev

pip install https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases/download/v1.1.8/pyds-1.1.8-py3-none-linux_aarch64.whl

Right now I have cleared gstreamer cache:
rm ${HOME}/.cache/gstreamer-1.0/*

Now the deepstream_test1 is working.

The error occurs for the opticalflow demo.

Some progress at least.

So I wanted to try::
sudo apt install python3-gi python3-dev python3-gst-1.0 python-gi-dev git meson
python3 python3-pip python3.10-dev cmake g++ build-essential libglib2.0-dev
libglib2.0-dev-bin libgstreamer1.0-dev libtool m4 autoconf automake libgirepository1.0-dev libcairo2-dev

But why python3.10-dev?

Python3.8 is recommended.

So changed to python3.8 in the command above (with python3.10 was not working), then pip install … pyds.

Still opticalflow is not working

Please share the complete error log. If the following code has an error, please check whether the dependency is installed correctly.

encoder = Gst.ElementFactory.make("avenc_mpeg4", "encoder")
    if not encoder:
        sys.stderr.write(" Unable to create encoder \n")
    encoder.set_property("bitrate", 2000000)
    print("Creating Code Parser \n")
    codeparser = Gst.ElementFactory.make("mpeg4videoparse", "mpeg4-parser")
    if not codeparser:
        sys.stderr.write(" Unable to create code parser \n")
    print("Creating Container \n")
    container = Gst.ElementFactory.make("qtmux", "qtmux")
    if not container:
        sys.stderr.write(" Unable to create code parser \n")
sudo apt install \
libssl3 \
libssl-dev \
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

Complete error log:

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-opticalflow$ python3 deepstream-opticalflow.py file:///opt/nvidia/deepstream/deepstream-6.3/samples/streams/sample_720p.mp4 /home/nvidia/Desktop/output
Creating Pipeline 
 
Creating streamux 
 
Creating source_bin  0  
 
Creating source bin
source-bin-00
Creating tiler 
 
Creating nv optical flow element 

Creating nv optical flow visualisation element 

Creating queue 
 
Creating queue 

Creating Queue 

Creating nvosd 
 
Creating converter 2

Creating capsfilter 

Creating Encoder 

 Unable to create encoder 
Traceback (most recent call last):
  File "deepstream-opticalflow.py", line 377, in <module>
    sys.exit(main(sys.argv))
  File "deepstream-opticalflow.py", line 288, in main
    encoder.set_property("bitrate", 2000000)
AttributeError: 'NoneType' object has no attribute 'set_property'

Also tried the above command,
E: Unable to locate package libssl3
Tried without it. passing. But still the same error.

As I see the plugin is not installed:

gst-inspect-1.0 avenc_mpeg4
No such element or plugin 'avenc_mpeg4'

So I tried:

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-opticalflow$ apt-get install -y gstreamer1.0-libav
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-opticalflow$ sudo 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 libx264-155 libx265-179 libvpx6 libmpeg2encpp-2.1-0 libmpeg2-4 libmpg123-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 20 reinstalled, 0 to remove and 122 not upgraded.
Need to get 0 B/18,8 MB of archives.
After this operation, 0 B of additional disk space will be used.
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 162438 files and directories currently installed.)
Preparing to unpack .../00-gstreamer1.0-plugins-bad_1.16.3-0ubuntu1.1_arm64.deb ...
Unpacking gstreamer1.0-plugins-bad:arm64 (1.16.3-0ubuntu1.1) over (1.16.3-0ubuntu1.1) ...
Preparing to unpack .../01-gstreamer1.0-plugins-good_1.16.3-0ubuntu1.3_arm64.deb ...
Unpacking gstreamer1.0-plugins-good:arm64 (1.16.3-0ubuntu1.3) over (1.16.3-0ubuntu1.3) ...
Preparing to unpack .../02-gstreamer1.0-plugins-ugly_1.16.2-2build1_arm64.deb ...
Unpacking gstreamer1.0-plugins-ugly:arm64 (1.16.2-2build1) over (1.16.2-2build1) ...
Preparing to unpack .../03-libavcodec-dev_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavcodec-dev:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../04-libavcodec58_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavcodec58:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../05-libavfilter7_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavfilter7:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../06-libavformat-dev_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavformat-dev:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../07-libavformat58_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavformat58:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../08-libavresample-dev_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavresample-dev:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../09-libavresample4_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavresample4:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../10-libavutil-dev_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavutil-dev:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../11-libavutil56_7%3a4.2.7-0ubuntu0.1_arm64.deb ...
Unpacking libavutil56:arm64 (7:4.2.7-0ubuntu0.1) over (7:4.2.7-0ubuntu0.1) ...
Preparing to unpack .../12-libde265-0_1.0.4-1ubuntu0.4_arm64.deb ...
Unpacking libde265-0:arm64 (1.0.4-1ubuntu0.4) over (1.0.4-1ubuntu0.4) ...
Preparing to unpack .../13-libde265-dev_1.0.4-1ubuntu0.4_arm64.deb ...
Unpacking libde265-dev:arm64 (1.0.4-1ubuntu0.4) over (1.0.4-1ubuntu0.4) ...
Preparing to unpack .../14-libmpeg2-4_0.5.1-9_arm64.deb ...
Unpacking libmpeg2-4:arm64 (0.5.1-9) over (0.5.1-9) ...
Preparing to unpack .../15-libmpeg2encpp-2.1-0_1%3a2.1.0+debian-6build1_arm64.deb ...
Unpacking libmpeg2encpp-2.1-0:arm64 (1:2.1.0+debian-6build1) over (1:2.1.0+debian-6build1) ...
Preparing to unpack .../16-libmpg123-0_1.25.13-1ubuntu0.2_arm64.deb ...
Unpacking libmpg123-0:arm64 (1.25.13-1ubuntu0.2) over (1.25.13-1ubuntu0.2) ...
Preparing to unpack .../17-libvpx6_1.8.2-1ubuntu0.4_arm64.deb ...
Unpacking libvpx6:arm64 (1.8.2-1ubuntu0.4) over (1.8.2-1ubuntu0.4) ...
Preparing to unpack .../18-libx264-155_2%3a0.155.2917+git0a84d98-2_arm64.deb ...
Unpacking libx264-155:arm64 (2:0.155.2917+git0a84d98-2) over (2:0.155.2917+git0a84d98-2) ...
Preparing to unpack .../19-libx265-179_3.2.1-1build1_arm64.deb ...
Unpacking libx265-179:arm64 (3.2.1-1build1) over (3.2.1-1build1) ...
Setting up libmpg123-0:arm64 (1.25.13-1ubuntu0.2) ...
Setting up libx264-155:arm64 (2:0.155.2917+git0a84d98-2) ...
Setting up libx265-179:arm64 (3.2.1-1build1) ...
Setting up libmpeg2-4:arm64 (0.5.1-9) ...
Setting up libavutil56:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libmpeg2encpp-2.1-0:arm64 (1:2.1.0+debian-6build1) ...
Setting up libvpx6:arm64 (1.8.2-1ubuntu0.4) ...
Setting up gstreamer1.0-plugins-ugly:arm64 (1.16.2-2build1) ...
Setting up libavcodec58:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libde265-0:arm64 (1.0.4-1ubuntu0.4) ...
Setting up libavutil-dev:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libavformat58:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libavcodec-dev:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up gstreamer1.0-plugins-good:arm64 (1.16.3-0ubuntu1.3) ...
Setting up libavformat-dev:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libavresample4:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libde265-dev:arm64 (1.0.4-1ubuntu0.4) ...
Setting up gstreamer1.0-plugins-bad:arm64 (1.16.3-0ubuntu1.1) ...
Setting up libavfilter7:arm64 (7:4.2.7-0ubuntu0.1) ...
Setting up libavresample-dev:arm64 (7:4.2.7-0ubuntu0.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.16) ...

Still the same problem

These will not work, avenc_mpeg4 is part of gstreamer1.0-libav

I have changed avenc_mpeg4 to x264enc and it is working for me.
The video output is saving to the output folder.

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