Deepstream feeding Mediamtx stream webrtc

x86 Nvidia GeForce RTX 4080
DeepStream 7.0
NVIDIA GPU Driver Version: 535.183.01
CUDA Version: 12.2

I want to modify the deepstream_test1_rtsp_in_rtsp_out.py example so that instead of creating my own rtsp server, it sends the h.264 stream to the Mediamtx server, so that I can easily take the Webrtc stream. Replicating what the command does: gst-launch-1.0 rtspclientsink name=s location=rtsp://localhost:8554/mystream …
I’ve tried to do it with these commands but I can’t seem to get the links in the pipeline right:

x264enc = Gst.ElementFactory.make("x264enc", "encoder") #rtsp
if not x264enc:
    sys.stderr.write(" Unable to create x264enc \n")
rtspclientsink = Gst.ElementFactory.make("rtspclientsink", "sink") #rtsp
if not rtspclientsink:
    sys.stderr.write(" Unable to create rtspclientsink \n")
    
x264enc.set_property("speed-preset", "veryfast") #rtsp
x264enc.set_property("tune", "zerolatency") #rtsp
x264enc.set_property("bitrate", 800) #rts
rtspclientsink.set_property("location", "rtsp://localhost:8554/cam1") #rtsp

Any sugestion?

Hello @martin.sepulveda1,

Have you tried running a simple pipeline without deepstream ?

gst-launch-1.0 videotestsrc \
! video/x-raw,width=1920,height=1080,format=I420 \
! x264enc speed-preset=ultrafast bitrate=2000 \
! video/x-h264,profile=baseline \
! whipclientsink signaller::whip-endpoint=http://localhost:8889/mystream/whip

If you are able to get this to work, we would recommend start adding deepstream starting from that pipeline.

Then you can modify the sample app to use parse_launch instead of creating the pipe element by element.

Please let us know if you require further assistance with this, we would love to help.

regards,
Andrew

after encoding, there is no any NV plugins, could you narrow down this issue?

Hi Andrew!! Thanks so much. I solver with this code
3.txt (18.8 KB)
I took it from this forum too. :) Best regards!

Hello @martin.sepulveda1,

That is great to hear!

Thanks for sharing.

Hopefully we were able to help a bit.

Please don’t hesitate to reach out if in the future you require assistance with anything else.

regards,
Andrew

@martin.sepulveda1 just to let you know, deepstream-app supports this out of the box by setting sink type to 4.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.