How to prevent huge RTP h264 livestream quality drops?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to prevent huge RTP h264 livestream quality drops?

czar1na
Hi all,

First of all, I'm a beginner to gstreamer, but I've been enjoying using it so far!

I have a Pi Zero with a Pi camera and a mic. I'm livestreaming audio/video from the Pi to a remote server with a NGinx frontend running a Janus webRTC gateway. I'm using gstreamer from the Pi to send RTP to Janus. I am looking for < 1s latency (but does not have to be <500ms) and relatively consistent A/V quality.

My full Pi command: 

gst-launch-1.0 -v rpicamsrc bitrate=500000 inline-headers=TRUE keyframe-interval=4 preview=0 ! video/x-h264,width=1280,height=720,framerate=20/1,profile=baseline ! \

h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=XXXX port=8004 \

alsasrc device=mic_mono buffer-time=1000000 ! audio/x-raw,format=S32LE,rate=22050,channels=1 ! \

audioconvert ! audioresample ! opusenc complexity=3 cbr=TRUE ! rtpopuspay ! udpsink host=XXXX port=8005


My video quality is great until there's a lot of movement in front of the camera. When this happens, the video quality drops by a lot, with every frame looking like this: http://imgur.com/a/ArPi4 Normally it looks like this: http://imgur.com/a/WAaoo

I understand UDP is unreliable and packet drops may occur. But can anyone suggest how I could optimize my settings to prevent such huge drops in video quality? Perhaps if I added a little more latency, or some other settings I can tweak? 

Thanks so much!

Christina




_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to prevent huge RTP h264 livestream quality drops?

Arjen Veenhuizen
Did you try bumping the bitrate? 500kbps is not a lot for 720p. That at least could help you rule out network issues/packet drops. (the artifacts on your "bad" thumbnail suggest low bitrate encoding as well by the way)