Share video, screen, camera and audio with an RTSP stream through Lan or Wan supporting CUDA computations in a High Performance embedded environment (Nvidia Jetson Nano), applying real-time AI techiques of Intrusion Detection with bounding boxes localization and frames manipulations.
A demonstration video can be found here: https://www.youtube.com/watch?v=gbF5GQyb1T8
NV Developer Jetson Projects forum post: https://devtalk.nvidia.com/default/topic/1065923/jetson-projects/multimedia-sharing-tool-a-jetson-nano-project/
Before installing dependencies:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install gcc
$ sudo apt-get install cmake
$ sudo apt-get install git
$ sudo apt-get install libgtk2.0-dev
On ARM architectures: sudo apt-get install qt5-default qtcreator -y
Other architectures: QT Home Page
Add the CUDA directory to $PATH
$ export PATH=${PATH}:/usr/local/cuda/bin
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
- Update your Nvidia GPU driver with the latest Nvidia proprietary one
- Install CUDA Toolkit following the CUDA Installation Guide
$ sudo apt-get install libcurl4-openssl-dev
- (Non Jetson users only) Copy
glibconfig.h
header to/usr/include/glib-2.0/
$ sudo cp /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/glibconfig.h
- Follow the Build instructions from the Jetson-inference GitHub page.
N.B. (Non Jetson users only)
Once downloaded the Jetson-inference library and before building the project, check that inside CMakeLists.txt your GPU architecture is specified (e.g.-gencode arch=compute_62,code=sm_62
). Otherwise add it.
A list of Nvidia GPU architectures could be found here
$ sudo apt-get install ffmpeg
- Remove any previous installations of x264
$ sudo apt-get remove x264 libx264-dev
-
(Jetson Nano only) Set a swap file to allow the system to use more than 4 GB of RAM
A swap file installer could be found here -
Install OpenCV dependencies
$ sudo apt-get install build-essential checkinstall cmake pkg-config yasm
$ sudo apt-get install git gfortran
$ sudo apt-get install libjpeg8-dev libjasper-dev libpng12-dev
$ sudo apt-get install libtiff5-dev
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
$ sudo apt-get install libxine2-dev libv4l-dev
$ sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
$ sudo apt-get install libqt4-dev libtbb-dev
$ sudo apt-get install libatlas-base-dev
$ sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev
$ sudo apt-get install libvorbis-dev libxvidcore-dev
$ sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev
$ sudo apt-get install x264 v4l-utils
- Clone
opencv
andopencv_contrib
version 3.4.7 repository
$ git clone -b 3.4.7 https://github.com/opencv/opencv
$ git clone -b 3.4.7 https://github.com/opencv/opencv_contrib
- Make a directory i.e.
build
insideopencv
directory, build and install the library
$ mkdir build
$ cd build
$ cmake -D CMAKE_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 INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \
-D WITH_GTK=ON \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D BUILD_opencv_cudacodec=OFF \
-D BUILD_EXAMPLES=ON ..
$ nproc
# use the number that nproc returns which is the number of cores of your processor. Let's say it returns 4.
$ make -j4
$ sudo make install
- Clone the project
$ git clone https://github.com/Werther158/multimedia_sharing_tool
- Open the
.pro
file with QT Creator - Set
multimedia_sharing_tool/build/debug
andmultimedia_sharing_tool/build/release
as debug and release directories - Build the project