1

I am trying to stream my rpi-camera to my webbrowser. I would like to use webrtc. I have tried using (and modifying) this GStreamer WebRTC demos for webrtc using gstreamer. I can successfully stream vp8 to my browser, the issue is that it is taxing on the cpu to take the h264 frames from the camera and convert it to vp8 then send to the browser via webrtc.

I figure, okay, chrome and firefox support h264, so does webrtc, and so does raspivid. When I try passing the stream directly to the webrtcbin it will send it to the browser but with a lot of stuttering or out right artifacts:

This trying to use the videotestsrc element converting it to h264 and sending it to the webrtcbin

Is there some magic sauce that will allow me to stream the camera to the browser? I am unsure if its an issue with what profile/level the h264 stream is (although this is what I suspect).

I also looked at webrtc-unidirectional-h264.c and see that the profile is constrained-baseline with level 3.0. is there a way I can get the camera to output this or do I always need to convert it? AFAIK raspivid does not do profiles lower than baseline and level lower than 4. Can this be the issue?

I am stuck here anyone care to shed some light.

Ingo
  • 42,961
  • 20
  • 87
  • 207
Kevin
  • 131
  • 1
  • 9

2 Answers2

1

I have found that the solution mentioned in

https://www.linux-projects.org/uv4l/installation/

works well. Out-of-the box, the video will have a text overlay, but if you give a "contribution" of $15 or so, and email the author, you can get a key that removes the text. I'm getting low-latency (0.5 sec or so) video at 1280 X 960 @ 30fps from a Model 3B Raspberry pi and the Raspberry pi camera. The resultant h.264 video stream is directly viewable in CHROME or Firefox.
Note that I'm not doing 2-way video or audio of any kind, although it is supposed to be capable of that. The program has a lot of options.

0

You can try my project, it makes your H264 camera viewable in any browser. (or your basic usb camera, if your hw has m2m compatible h264 encoder, like the rpi) https://github.com/soyersoyer/fmp4streamer

soyer
  • 161
  • 5