DeepStream Reference Designs/Getting Started/Environment Setup: Difference between revisions

From RidgeRun Developer Wiki
 
(30 intermediate revisions by 3 users not shown)
Line 8: Line 8:
We offer several versions of the system, all based on the NVIDIA Jetson boards. Small places that use a single or dual camera may use a Jetson Nano, while big commerce with 32 cameras may need to use the Jetson Xavier AGX.
We offer several versions of the system, all based on the NVIDIA Jetson boards. Small places that use a single or dual camera may use a Jetson Nano, while big commerce with 32 cameras may need to use the Jetson Xavier AGX.
* RTSP Cameras: 1 to 8 simultaneous cameras.
* RTSP Cameras: 1 to 8 simultaneous cameras.
* Jetson Board: portable through Jetson Nano, TX2, NX, and AGX development kits.
* Jetson Board: portable through Jetson Orin, Nano, TX2, NX, and AGX development kits.


The system is based on [https://developer.nvidia.com/deepstream-sdk NVIDIA's DeepStream SDK] to take advantage of the board's hardware and multimedia capabilities. The DeepStream version used in this project is 6.0.1, which is included as part of the NVIDIA Jetpack 4.6.1. In case you need to install JetPack SDK 4.6, NVIDIA provides the Image SD Card method or it can also be installed through the NVIDIA SDK Manager. For more information on such installation methods, you can refer to the official NVIDIA documentation at the following [https://developer.nvidia.com/embedded/jetpack-sdk-46 Link].
The system is based on [https://developer.nvidia.com/deepstream-sdk NVIDIA's DeepStream SDK] to take advantage of the board's hardware and multimedia capabilities. The DeepStream version used in this project is 6.0, which is included as part of the NVIDIA JetPack 4.6. In case you need to install JetPack SDK 4.6, NVIDIA provides the Image SD Card method or it can also be installed through the NVIDIA SDK Manager. For more information on such installation methods, you can refer to the [https://developer.nvidia.com/embedded/jetpack-sdk-46 '''JETPACK SDK 4.6 RELEASE PAGE''']official NVIDIA documentation.


== Dependencies ==
== Dependencies ==
Line 24: Line 24:
* python3-pip
* python3-pip


'''Linux'''
You may install the dependencies with the following command:  
 
In Debian based systems, you may install the dependencies with the following command:  
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
sudo apt-get install -y python3 python3-pip python3-setuptools python3-wheel ninja-build pkg-config gtk-doc-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-libav libopencv-dev
$ sudo apt-get install -y python3 python3-pip python3-setuptools python3-wheel ninja-build pkg-config gtk-doc-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-libav libopencv-dev
</syntaxhighlight>
</syntaxhighlight>


Line 34: Line 32:


To handle the media instances used in this project, we rely on the methods provided by the Python API of [https://developer.ridgerun.com/wiki/index.php/GStreamer_Daemon Gstreamer Daemon (GstD)]. In order to install GStreamer Daemon, we invite you to refer to the following [https://developer.ridgerun.com/wiki/index.php/GStreamer_Daemon_-_Building_GStreamer_Daemon installation guide].
To handle the media instances used in this project, we rely on the methods provided by the Python API of [https://developer.ridgerun.com/wiki/index.php/GStreamer_Daemon Gstreamer Daemon (GstD)]. In order to install GStreamer Daemon, we invite you to refer to the following [https://developer.ridgerun.com/wiki/index.php/GStreamer_Daemon_-_Building_GStreamer_Daemon installation guide].
== GstInterpipe ==
The media descriptors built in this project use the Gstreamer plugin called [https://developer.ridgerun.com/wiki/index.php/GstInterpipe GstInterpipe]. To install this plugin, we invite you to follow the [https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_Building_and_Installation_Guide building and installation guide].


== AMQP Protocol Adapter ==
== AMQP Protocol Adapter ==
Line 43: Line 45:
</syntaxhighlight>
</syntaxhighlight>


The AMQP protocol adapter also has its own dependencies, which can be found in this [https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvmsgbroker.html#id3 installation guide]. And if you don't have a functioning broker already, you can install the [https://www.rabbitmq.com/install-debian.html RabbitMQ package] on your local system or on the remote machine where you want the broker to be installed, with the following command:
The AMQP protocol adapter also has its own dependencies. To install the additional dependencies, you can run the following command:
 
<syntaxhighlight lang="bash">
$ sudo apt-get install libglib2.0 libglib2.0-dev libssl-dev
</syntaxhighlight>
 
AMQP protocol adapter for DeepStream uses the librabbitmq.so library, built from [https://github.com/alanxz/rabbitmq-c rabbitmq-c] for the underlying AMQP protocol implementation. To build the library, you may enter the following commands:
 
<syntaxhighlight lang="bash">
$ git clone -b v0.8.0  --recursive https://github.com/alanxz/rabbitmq-c.git
$ cd rabbitmq-c
$ mkdir build && cd build
$ cmake ..
$ cmake --build .
</syntaxhighlight>
 
To copy the built librabbitmq.so library to its final location on the Jetson, enter the following command:
 
<syntaxhighlight lang="bash">
$ sudo cp ./librabbitmq/librabbitmq.so.4 /usr/lib/aarch64-linux-gnu/
</syntaxhighlight>
 
The AMQP protocol communicates with an AMQP 0-9-1 compliant message broker like [https://www.rabbitmq.com/ RabbitMQ]. In this project, we use docker to build an image with the RabbitMQ message broker. Docker is one of the packages installed as part of NVIDIA JetPack 4.6, so no extra installation is required. You can check the docker version installed on the Jetson with the following command:
 
<syntaxhighlight lang="bash">
$ docker --version
Docker version 20.10.2, build 20.10.2-0ubuntu1~18.04.2
</syntaxhighlight>
 
The first time you run the project, docker will display a message indicating that it could not find the RabbitMQ image locally, however, it will automatically search the remote server to install it correctly.
 
== Nvmsgconv Plugin ==
 
As part of its components, this project uses the DeepStream plugin called [https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvmsgconv.html Gst-nvmsgconv] to build the payload messages that will be transmitted by the broker. If you want to know more about this module and its role within the system you can review the Wiki section of [https://developer.ridgerun.com/wiki/index.php/DeepStream_Reference_Designs/Reference_Designs/Automatic_Parking_Lot_Vehicle_Registration#Inference_Parser APLVR Inference Parser]. By default, the library required by the DeepStream pipeline to use nvmsgconv is not built. So in a terminal, you should navigate to the following path and run the make command:
 
<syntaxhighlight lang="bash">
$ cd /opt/nvidia/deepstream/deepstream-6.0/sources/libs/nvmsgconv/ && sudo make
</syntaxhighlight>
 
After that, you can inspect the library generated with the "ls" command, and  the directory should have the following library (among other files):


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo apt-get install rabbitmq-server
$ ls
...
libnvds_msgconv.so
...
</syntaxhighlight>
</syntaxhighlight>
   
   
<noinclude>
<noinclude>
{{DeepStream Reference Designs/Foot|Getting Started| Getting Started/Evaluating the Project}}
{{DeepStream Reference Designs/Foot|Getting Started|Getting Started/Evaluating the Project}}
</noinclude>
</noinclude>

Latest revision as of 18:14, 3 August 2022




Previous: Getting Started Index Next: Getting Started/Evaluating the Project




System Setup

We offer several versions of the system, all based on the NVIDIA Jetson boards. Small places that use a single or dual camera may use a Jetson Nano, while big commerce with 32 cameras may need to use the Jetson Xavier AGX.

  • RTSP Cameras: 1 to 8 simultaneous cameras.
  • Jetson Board: portable through Jetson Orin, Nano, TX2, NX, and AGX development kits.

The system is based on NVIDIA's DeepStream SDK to take advantage of the board's hardware and multimedia capabilities. The DeepStream version used in this project is 6.0, which is included as part of the NVIDIA JetPack 4.6. In case you need to install JetPack SDK 4.6, NVIDIA provides the Image SD Card method or it can also be installed through the NVIDIA SDK Manager. For more information on such installation methods, you can refer to the JETPACK SDK 4.6 RELEASE PAGEofficial NVIDIA documentation.

Dependencies

This project has the following system dependencies:

  • pkg-config
  • gtk-doc-tools
  • libgstreamer1.0-dev
  • libgstreamer-plugins-base1.0-dev
  • gstreamer1.0-tools
  • gstreamer1.0-plugins-good
  • gstreamer1.0-libav
  • python3-pip

You may install the dependencies with the following command:

$ sudo apt-get install -y python3 python3-pip python3-setuptools python3-wheel ninja-build pkg-config gtk-doc-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-libav libopencv-dev

GstD

To handle the media instances used in this project, we rely on the methods provided by the Python API of Gstreamer Daemon (GstD). In order to install GStreamer Daemon, we invite you to refer to the following installation guide.

GstInterpipe

The media descriptors built in this project use the Gstreamer plugin called GstInterpipe. To install this plugin, we invite you to follow the building and installation guide.

AMQP Protocol Adapter

The project has a dependency on using a message broker like RabbitMQ. From DeepStream version 5.0, an AMQP protocol adapter is included that DeepStream applications can use out of the box to publish messages using AMQP 0-9-1 message protocol. The AMQP protocol adapter shared library is in the DeepStream package at:

/opt/nvidia/deepstream/deepstream-6.0/lib/libnvds_amqp_proto.so

The AMQP protocol adapter also has its own dependencies. To install the additional dependencies, you can run the following command:

$ sudo apt-get install libglib2.0 libglib2.0-dev libssl-dev

AMQP protocol adapter for DeepStream uses the librabbitmq.so library, built from rabbitmq-c for the underlying AMQP protocol implementation. To build the library, you may enter the following commands:

$ git clone -b v0.8.0  --recursive https://github.com/alanxz/rabbitmq-c.git
$ cd rabbitmq-c
$ mkdir build && cd build
$ cmake ..
$ cmake --build .

To copy the built librabbitmq.so library to its final location on the Jetson, enter the following command:

$ sudo cp ./librabbitmq/librabbitmq.so.4 /usr/lib/aarch64-linux-gnu/

The AMQP protocol communicates with an AMQP 0-9-1 compliant message broker like RabbitMQ. In this project, we use docker to build an image with the RabbitMQ message broker. Docker is one of the packages installed as part of NVIDIA JetPack 4.6, so no extra installation is required. You can check the docker version installed on the Jetson with the following command:

$ docker --version
Docker version 20.10.2, build 20.10.2-0ubuntu1~18.04.2

The first time you run the project, docker will display a message indicating that it could not find the RabbitMQ image locally, however, it will automatically search the remote server to install it correctly.

Nvmsgconv Plugin

As part of its components, this project uses the DeepStream plugin called Gst-nvmsgconv to build the payload messages that will be transmitted by the broker. If you want to know more about this module and its role within the system you can review the Wiki section of APLVR Inference Parser. By default, the library required by the DeepStream pipeline to use nvmsgconv is not built. So in a terminal, you should navigate to the following path and run the make command:

$ cd /opt/nvidia/deepstream/deepstream-6.0/sources/libs/nvmsgconv/ && sudo make

After that, you can inspect the library generated with the "ls" command, and the directory should have the following library (among other files):

$ ls
...
libnvds_msgconv.so
...



Previous: Getting Started Index Next: Getting Started/Evaluating the Project