• 3060
• DeepStream Version 6.4
• Bug
I would like to update my Deepstream application to 6.4
To ensure compatibility, I’ve had to upgrade GLib, as recommended in the release notes. Incidentally, I have a post associated with this upgrade that has been resolved: https://forums.developer.nvidia.com/t/glib-gthread-posix-c-unexpected-error-from-c-library-during-pthread-setspecific-invalid-argument-aborting/277705
Unfortunately, in resolving the error I was experiencing, the installation of GLib 2.76.6 “broke” support for TLS.
I need TLS to read rtsps streams (rtsp over tls).
I’ve prepared some files for you to replicate the error:
- Dockerfile :
FROM nvcr.io/nvidia/deepstream:6.4-gc-triton-devel as base
WORKDIR /opt/nvidia/deepstream/deepstream
RUN apt update && apt install -y \
python3-pip libcairo2-dev libcairo2 pkg-config python3-dev protobuf-compiler libyaml-cpp-dev libmpg123-0 libmpeg2-4 libavcodec58 \
# Install necessary packages for building GLib:
pkg-config python3-dev libffi-dev libmount-dev meson ninja-build wget
RUN python3.10 -m pip install --upgrade pip && pip3 install \
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases/download/v1.1.10/pyds-1.1.10-py3-none-linux_x86_64.whl
WORKDIR /opt/nvidia/deepstream/deepstream/lib
RUN wget https://github.com/GNOME/glib/archive/refs/tags/2.76.6.tar.gz
RUN tar -xzvf 2.76.6.tar.gz
RUN rm -r glib-2.76.6/subprojects/gvdb
# Building GLib 2.76.6 (required for DS 6.4)
# Change into the extracted directory
WORKDIR /opt/nvidia/deepstream/deepstream/lib/glib-2.76.6
# Configure the build
RUN meson _build
# Build GLib
RUN ninja -C _build
# Install GLib
RUN ninja -C _build install
# Copy library files to "standard path"
RUN rsync -av /usr/local/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/
WORKDIR /opt/nvidia/deepstream/deepstream
# Third stage: dev
FROM base as dev
ENTRYPOINT ["/bin/bash", "-c", "tail -f /dev/null"]
CMD []
- Execute container :
docker run --gpus all -it --rm --net=host --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-6.4 built_container
-
Enter the container
-
Add and run this python script to replicate error (you need to change for your own rtsps stream) :
import gi
gi.require_version("Gst", "1.0")
from gi.repository import Gst, GObject
import threading
import time
import sys
def cb_newpad(element, element_src_pad, data):
print("IN NEW PAD")
caps = element_src_pad.get_current_caps()
structure = caps.get_structure(0)
name = structure.get_name()
media_type = structure.get_value("media")
print(f"Pad added: {media_type} & {name}")
if media_type == "video" and name == "application/x-rtp":
print("Here we go")
sinkpad = data.get_static_pad("sink") #where data is depay element
print("Source pad capabilities:", element_src_pad.query_caps(None).to_string())
print("Sink pad capabilities:", sinkpad.query_caps(None).to_string())
if element_src_pad.link(sinkpad) != Gst.PadLinkReturn.OK:
print('Elements could not be linked: 1. Exiting.', flush=True)
sys.exit(-1)
def on_error(bus, message):
err, debug = message.parse_error()
print(f"Error: {err}, {debug}")
def main():
GObject.threads_init()
Gst.init(None)
# Iterate over all plugins
for plugin in Gst.Registry.get().get_plugin_list():
# Print plugin name
print("Plugin:", plugin.get_name(), flush=True)
# Iterate over all features of each plugin
for feature in Gst.Registry.get().get_feature_list_by_plugin(plugin.get_name()):
# Print feature name (this includes elements)
print(" Feature:", feature.get_name(), flush=True)
# Set the default debug threshold
Gst.debug_set_default_threshold(3)
pipeline = Gst.Pipeline.new("dstest-sr-pipeline")
source = Gst.ElementFactory.make("rtspsrc", "rtsp-source")
source.set_property("location", "rtsps://modeluser:rKJAhFa1GbR9@drio.app:5541/tec/SSB_cam1_h264")
source.set_property("protocols", 4)
depay_pre_decode = Gst.ElementFactory.make("rtph264depay", "h264-depay")
parse = Gst.ElementFactory.make("h264parse", "parse")
source.connect("pad-added", cb_newpad, depay_pre_decode)
decoder = Gst.ElementFactory.make("nvv4l2decoder", "nvv4l2-decoder")
convert = Gst.ElementFactory.make("nvvideoconvert", "convert")
caps = Gst.Caps.from_string("video/x-raw,width=1920,height=1080,formate=I420")
filter = Gst.ElementFactory.make("capsfilter", "filter")
filter.set_property("caps", caps)
queue = Gst.ElementFactory.make("queue", "queue")
sink = Gst.ElementFactory.make("nveglglessink", "video-sink")
sink.set_property("window-x", 0)
sink.set_property("window-y", 0)
sink.set_property("window-width", 1280)
sink.set_property("window-height", 720)
pipeline.add(source)
pipeline.add(depay_pre_decode)
pipeline.add(parse)
pipeline.add(decoder)
pipeline.add(convert)
pipeline.add(filter)
pipeline.add(queue)
pipeline.add(sink)
if not depay_pre_decode.link(parse):
print('Could not link depay_pre_decode to parse. Exiting.')
sys.exit(-1)
if not parse.link(decoder):
print('Could not link parse to decoder. Exiting.')
sys.exit(-1)
if not decoder.link(convert):
print('Could not link decoder to convert. Exiting.')
sys.exit(-1)
if not convert.link(filter):
print('Could not link convert to filter. Exiting.')
sys.exit(-1)
if not filter.link(queue):
print('Could not link filter to queue. Exiting.')
sys.exit(-1)
if not queue.link(sink):
print('Could not link queue to sink. Exiting.')
sys.exit(-1)
bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect("message::error", on_error)
# Mettre le pipeline en lecture
ret = pipeline.set_state(Gst.State.PLAYING)
if ret == Gst.StateChangeReturn.FAILURE:
print("Unable to set the pipeline to the playing state.", flush=True)
exit(-1)
# Attendre que le pipeline rencontre une erreur ou EOS
print("Running...")
main_loop = GObject.MainLoop()
try:
main_loop.run()
except KeyboardInterrupt:
pass
finally:
pipeline.set_state(Gst.State.NULL)
main_loop.quit()
if __name__ == "__main__":
main()
- Here is the error :
0:00:00.569020744 43 0x7f0720000e50 ERROR default gstrtspconnection.c:1102:gst_rtsp_connection_connect_with_response_usec: failed to connect: TLS support is not available
0:00:00.569033619 43 0x7f0720000e50 ERROR rtspsrc gstrtspsrc.c:5238:gst_rtsp_conninfo_connect:<rtsp-source> Could not connect to server. (Generic error)