Difference between revisions of "Upgrading GStreamer version of NVIDIA Jetson"

From RidgeRun Developer Connection
Jump to: navigation, search
m
m
Line 1: Line 1:
 +
<seo title="Upgrading Jetson's GStreamer version | RidgeRun" titlemode="replace" metakeywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, GPU, GStreamer, NVIDIA, Jetson, TX1, TX2, Jetson Nano, Nano, NVIDIA Jetson Nano, Jetson AGX Xavier, Xavier, AI, Deep Learning, Jetson TX1, Jetson TX2, Jetson Xavier, NVIDIA Jetson Xavier, NVIDIA Jetson Orin, Jetson Orin, Orin, NVIDIA Orin, NVIDIA Jetson AGX Orin, Jetson AGX Orin" metadescription="Steps to how to install a GStreamer version on the Jetson other than the one installed by the SDK."></seo>
 +
 
__TOC__
 
__TOC__
  

Revision as of 14:09, 31 July 2023

The following wiki guides on how to install a GStreamer version on the Jetson other than the one installed by the SDK. It also has information on how to build the Jetson's accelerated GStreamer elements so that they run correctly in the new version.

This has been tested on an NVIDIA Orin AGX using Jetpack 5.1.1.

Upgrading GStreamer

More details at Setting a GStreamer Alternative Environment-GStreamer-1.16 through GStreamer-1.19

By running these steps for the desired version, you'll have all the software elements built for the specific version. Do note that you might need to install some development libraries for a given element if it is not being built out of the box.

GStreamer 1.16-1.19

git clone https://github.com/GStreamer/gst-build --branch 1.18.6
cd gst-build
meson builddir
ninja -C builddir

GStreamer >= 1.20

git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git -b 1.22
cd gstreamer
meson builddir
ninja -C builddir

Installing NVIDIA elements

  • This guide only installs nvvidconv, the nvcompositor, and the nvdecoder/encoders, for others the process should be pretty similar, although you might need to patch the Makefile similarly to how this is done for some of these elements.
  • Each element is independent of each other, you don't need to install all of them for one of them to work. However, the nvvidconv is used in most pipelines to convert from CPU memory to NVMM memory, so it is commonly needed for most use cases.

Go to https://developer.nvidia.com/embedded/jetson-linux-archive and select the corresponding L4T to the installed Jetpack. From there download the Driver Package (BSP) Sources tarball, and copy it over to the Jets

Activate the environment

  • This is only needed if you didn't install the newer version and want to keep the SDK's version. At the end of this section, there are instructions on how to add each element to the development environment.
# This assumes that you only built the environment and didn't install it
cd gst-build 
# For >=1.20
cd gstreamer

ninja -C builddir devenv

Extract the sources

cd ~ # Assuming that this is where you copied the public_sources.tbz2 tarball

tar xvf public_sources_3531.tbz2

cd Linux_for_Tegra/source/public/

NVencoder/decoder

# NVdecoder/encoder
tar xvf gst-nvvideo4linux2_src.tbz2
cd gst-v4l2
make 
cd ..

# Add plugins to the path without installing
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD/gst-v4l2/

Nvvidconv

tar xvf gst-nvvidconv_src.tbz2
cd gst-nvvidconv/

cat > nvvidconv_makefile.patch << EOF
--- Makefile
+++ Makefile
@@ -46,6 +46,8 @@
 INCLUDES += -I\$(CUDA_PATH)/include
 INCLUDES += -I\$(CUDA_PATH)/targets/\$(ARCH)-linux/include
 
+INCLUDES += -I/opt/nvidia/deepstream/deepstream/sources/includes/
+
 INCLUDES += -I./
 
 PKGS := gstreamer-1.0 \

EOF

patch < nvvidconv_makefile.patch
make 
cd ..

# Add plugins to the path without installing
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD/gst-nvvidconv/

NvCompositor

tar xvf gst-nvcompositor_src.tbz2
cd gst-nvcompositor/

cat > nvcompositor_makefile.patch << EOF
--- Makefile	2023-06-20 22:42:32.041529245 +0000
+++ Makefile	2023-06-20 22:42:01.429480422 +0000
@@ -35,7 +35,15 @@
 
 SRCS := $(wildcard *.c)
 
+ARCH := $(shell uname -m)
+ifdef CUDA_VER
+CUDA_PATH := /usr/local/cuda-$(CUDA_VER)
+else
+CUDA_PATH := /usr/local/cuda
+endif
+
 INCLUDES += -I./
+INCLUDES += -I/opt/nvidia/deepstream/deepstream/sources/includes/
 
 PKGS := gstreamer-1.0 \
 	gstreamer-base-1.0 \
@@ -54,7 +62,7 @@
 LDFLAGS = -Wl,--no-undefined -L$(LIB_INSTALL_DIR) -Wl,-rpath,$(LIB_INSTALL_DIR)
 LDFLAGS += -L$(CUDA_PATH)/targets/$(ARCH)-linux/lib/
 
-LIBS += `pkg-config --libs $(PKGS)`
+LIBS += `pkg-config --libs $(PKGS)` -lnvbufsurface -lnvbufsurftransform -lcudart
 
 all: $(SO_NAME)
 
EOF

patch < nvcompositor_makefile.patch
make 
cd ..

# Add plugins to the path without installing
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD/gst-nvcompositor/


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png