Live-Streaming a virtual-interactive RC Car race for MakerFaire.
Recently I was creating a large-scale interactive virtual event for the “Virtual” East Bay Mini MakerFaire. We had built a WebRTC platform for driving real-life RC Cars on a track via the web, so all the event participants could take turns racing real RC Cars over the internet. The plan was to live-stream the track and incorporate it on the main MakerFaire page for everyone attending to see.
I was using the WebRTC stack on the Raspberry Pi to provide really low latency (<100ms) for the video and controls while someone was racing, with up to 2 participants able to race at a time. For everyone viewing the race, either from the MakerFaire webpage, or while waiting for their turn on the dedicated racing page, they were provided the live-stream.
Due to the bandwidth requirements of live-streaming to all the participants of the event (several hundred people) I couldn’t directly provide the stream myself. I needed a rebroadcaster to retransmit my stream and handle the bandwidth and ideally the conversion from a simpler streaming format such as RTSP to web-compatible formats.
AngelCam had an interesting solution, arrow-client (https://github.com/angelcam/arrow-client) that I could install on a Raspberry Pi with camera, and arrow-client would forward the camera feed from the Pi to AngelCam, who in turn converted it and rebroadcast it to 100s of participants. I was using rtsp-simple-server to capture the Raspberry Pi camera using hardware acceleration (h264_omx), and then providing that RTSP source “http://127.0.0.1:8554/cam” via arrow-client to AngelCam.
This all worked great during the event, the stream was live on the MakerFaire site, it integrated into the fullscreen WebRTC view while people were waiting their turn, and allowed the Virtual RC Racing to be a success.
There were some minor hiccups along the way… the iFrame that AngelCam provides for Premium and above wasn’t iPhone friendly, it couldn’t auto-play (which I had working with prerecorded video), and when played would takeover the screen by forcing itself on-top on the iPhone, blocking users from playing the WebRTC racing beneath. This all worked correctly on Android, Desktop Chrome/Safari/Firefox. I did eventually find a workaround, which I will likely post as a separate topic. Also, AngelCam had issues when I used rtsp-simple-server with a software encoded h264, but worked great with the hardware encoded stream (very odd, its usually the other way round).
Thanks again AngelCam, you enabled me to create something interesting and fun to share with the kids of MakerFaire.
Source Code Available: https://github.com/mhungerford/WannaPlayWebRTC