• DeepStream Version 6.x
This sample is modified from deepstream-test3. User can use VLC to watch this rtsp stream remotely. User should install gstreamer rtsp server first.
sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
First you can check you environment is ready for rtsp streaming. Copy the rtsp server example here and compile this file.
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
Then start the test rtsp server. Note this command did not use nvvidconv
and nvv4l2h264enc
element like the reference post because it will cause a broken pipeline without any error in dGPU environment.
./test-launch "videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96"
Then you can start a client using VLC connect to rtsp://<host ip>:8554/test
. If it fail to connect, start a client in the same computer in another termal by
gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink
If success, the program will keep running without error.
After check the environment is OK, you can build the modified deepstream-test3 code in attachment. After compile the code, change the source-list:
in dstest3_config.yml
. Run the app with command
./deepstream-test3-app dstest3_config.yml
and use VLC connect to rtsp://<host ip>:8554/ds-test
then you can see the stream.
This example code copy functions start_rtsp_streaming
, client_filter
, destroy_sink_bin
from /opt/nvidia/deepstream/deepstream/sources/apps/apps-common/src/deepstream_sink_bin.c
The main idea is deepstream pipeline stream go to udp sink on 5400 port, and then we start a rtsp server using start_rtsp_streaming
. This rtsp server receive the udp as source and turn it into rtsp stream.
Reference:
deepstream-test3-rtsp.zip (14.8 KB)