Gstreamer - Webrtc should my pipeline be multipliexed?

Viewed 1672

What is happening:

I am curious about how I should set up my pipeline? I am sending a raw h264 stream to the browser via webrtc. I saw an example where raw vp8 was sent via webrtc.

Symptoms:

The reason I ask is that my video stream exhibits artifacts (garbled video?). The video will play for under a second (a few frames) and stop for about 5 seconds then play again for a few frames. I am trying to run this off of my raspberry pi.

What I tried:

I tried the same exact script using my laptop and it worked fine. I am not exactly sure why I would get garbled video from one device but not the other?

My first thought was that maybe it has to do with cpu bottleneck I looked at top on the pi and got 60%-100+%. (its encoding h264 on the fly). But could it be that it isn't buffering properly? I tried capturing an h264 stream from the rpi camera and the cpu is very low but exibit the same exact issue.

Even more interesting was that it seems to work fine when I use firefox with a few stops (video stoppes for < 1sec but continues). As to why I am unsure.

I am using gstreamer 1.15(git) on both my laptop and pi

Here is my pipeline:

PIPELINE_DESC = '''
webrtcbin name=sendrecv bundle-policy=max-bundle
 videotestsrc is-live=true ! x264enc ! h264parse ! rtph264pay config-interval=-1 ! 
 queue ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! rtpjitterbuffer ! sendrecv.
 audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay !
 queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! sendrecv.
'''
#this works videotestsrc h264enc on firefox, chrome gives artifacts

Here is what the video looks like coming from the pi:

enter image description here

We can see that the bottom is supposed to display a small box on the right with a snow pattern (like the stuff you see on old CRTs with no signal)

I am using this python project as my base, I just replaced the pipeline: https://github.com/centricular/gstwebrtc-demos

If anyone can give me a hand with figuring out why or what I can try that would be great.

0 Answers
Related