RTSP to webrtcbin streaming choppy

Hello, everyone.

I’m trying to developing application on Jetson Nano which receives RTSP stream and stream it to Chrome web browser.

So, I tested ‘webrtc-unidirectional-h.264.c’ from ‘centricular’ well-known as webrtcbin example and only modified pipeline from source code using nvidia deepstreaming plugins as below.

gst_parse_launch ("rtspsrc location=rtsp://admin:00000000@192.168.0.103/H.264/media.smp ! queue ! rtph264depay ! nvv4l2decoder ! nvvideoconvert ! video/x-raw(memory:NVMM),format=NV12 ! nvv4l2h264enc bitrate=4000000 ! rtph264pay name=pay0 pt=96 ! webrtcbin name=webrtcbin", &error);

But, video stream on Chrome is choppy, despite usage state of CPU and GPU on Nano is at low.

So, I changed video source to ‘nvarguscamerasrc’ and it has no problems!

gst_parse_launch ("nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1 ! nvv4l2h264enc bitrate=4000000 ! rtph264pay ! webrtcbin name=webrtcbin ", &error);

At now, I have no idea in gstreamer, deepstream plug-in, Chrome, … which side occurred this problem .
Can get any advice on this issue?

PS. Please refer my Jetson Nano’s state.

  1. Write image is downloaded on today from nvidia website.
  2. Deepstream SDK 5.0 installed and sample apps can runs.
  3. Install some libraries required by centricular examples. That’s it.
    sudo apt-get install -y gstreamer1.0-tools gstreamer1.0-nice gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good libgstreamer1.0-dev git libglib2.0-dev libgstreamer-plugins-bad1.0-dev libsoup2.4-dev libjson-glib-dev

Hi trueyan,

Based on your findings, seems RTSP stream origins the problem. However, have you tried to display the RTSP stream on Jetson Board?, it will confirm or not if the video stream is choppy from source.

Example:

gst-launch rtspsrc location=rtsp://admin:00000000@192.168.0.103/H.264/media.smp ! queue ! rtph264depay ! nvv4l2decoder ! nvvideoconvert ! nvoverlaysink

Regards
Angel

1 Like

@trueyan

I can confirm what @aphillipso has said. Some RTSP sources and the nvv4l2decoder don’t get along, but since you’re decoding h264 and then encoding h264, you might be able to just remove those elements from your pipeline. It looks like you might be able to go straight from rtspsrc to webrtcbin. That will run on a potato, and you’ll get better quality without the re-encode anyway.

1 Like

Thank you for reply!

RTSP source has no problem.
I tested it VLC player on my Windows 10 has no problems…
and your pipeline runs on my jetson nano is same ;)

Thank you for reply!

I tested rtspsrc-webrtcbin pipeline it runs ok.

rtspsrc location=rtsp://admin:00000000@192.168.0.103/H.264/media.smp ! queue ! webrtcbin name=webrtcbin

But my final goal is not so simple ;)
I want adding some information on the video by nvosd and stream it through RTSP and WebRTC simultaneously.
At now, my application has no problem on sending RTSP stream but WebRTC stream has this issue.

trueyan

You could use the uridecodebin or uridecodebin3 instead of rtspsrc directly, they may help to improve the stream quality.

Angel

2 Likes