Live Underwater Brodcast System for the 2014 Guinness World Record Scuba Diving Event

  hardware, linux, miscellaneous, raspberry-pi
For legal purposes: This entire live broadcast from the sea project was conceived by Alan Lupsha. I wrote all the software/code, Linux shell scripts, compiled all the VLC libraries from scratch, purchased all the equipment, installed all the networking equipment, antennas, cabling, integration, performed extensive troubleshooting, and operated and installed the underwater camera. My wife became friends with the UPS guy because of the large amount of deliveries to my house for parts that were used in this project.

Contents

Abstract

This article is a recollection of fun memories from the Guinness World Record Scuba Diving Event with Allen “The Grouper” Sherrod, and my personal involvement in building an underwater live streaming system to broadcast the event live to the world. In the end, Allen Sherrod broke the world record! Here’s how we did it.

The Idea to Build a Camera

Credits go to my friend Richard Black and John Boutin, who were incredibly helpful in getting this project going.

Initial Project 1 – Piggie, the Drives and the Pi

The first project idea was to use an existing housing that was already on the market, which has been proven to work in the underwater filming industry. One of the requirements was that I needed a camera housing that could also allow me to pass a cable through, sealed from water seeping in, in order to transmit the video feed through the cable. After some searching online, I found the Equinox Pro 8 underwater housing ( ex: http://www.railroadstudios.com/rentals/index.php?p=product&id=74&parent=79 ) for the Sony V1U camera. This seemed large enough, weighed 35 pounds, and was pricey, so it had to work. I ordered the housing, and began modifying it. My wife called it “Piggie”, because it looked fluffy and round like a little piggy, and the name stuck.

This is the component we are talking about:

The housing:

I decided to use a Raspberry Pi (RPi) (https://www.raspberrypi.org/ ) computer with a tiny camera, all mounted in the housing and hooked up to the waterproofed Ethernet cable. I also removed the camera knobs and switches and closed up all the holes. The only connection was through 1 hole, where the waterproofed Ethernet cable went into the housing.

Many days later, here was the finished product:

Components used:

The neat thing about this design was that the feed could be stored on two 1-terrabyte drives, so we would have enough space for HD quality video (think 1080p) for about 5 days of non-stop streaming. I wrote up some linux scripts which would stream 1-hour chunks of video, and then close the file, persist it, and start writing the next 1-hour stream. At the same time, the live stream was to be sent to Earthcam.com, in a lower definition video stream. I ended up testing this from my home in Tallahassee, over the course of a couple of days, using one of Earthcam.com’s secondary streams that they set up for us. It worked without issues. At some point when for a couple of days I was cat-sitting my friend’s kitten, I happened to be on the phone with one of the Earthcam engineers, and we were talking about testing the feed, and he told me he that he was seeing a black cat in front of the camera right at that very moment. Ah, the fun times.
Here are some useful commands from this setup:
# stream to file
raspivid -o - -t 9999999 -sh 55 -br 55 -vs -b 1500000 -w 1280 -h 720 > /mnt/pimount/live
 
# read from file and stream it
cvlc --ffmpeg-hw -vvv /mnt/pimount/live --sout '#rtp{sdp=rtsp://:8554}' :demux=h264


# convert a raw file to another format
cat /mnt/pimount/record1 | cvlc --ffmpeg-hw -vvv stream:///dev/stdin -sout '#duplicate{dst=file{dst=/mnt/pimount/record1.asf}}' :demux=h264
 
# Live stream to rtsp, open with VLC player, Control + L, and rtsp://127.0.0.1:8554/ (end slash needed)
raspivid -o - -t 9999999 -sh 55 -br 55 -vs -b 1500000 -w 1280 -h 720 | cvlc --ffmpeg-hw -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554}' :demux=h264


# stream a feed to a file
raspivid --output - --timeout 0 --sharpness 55 --brightness 55 --vstab --bitrate 1500000 --width 1280 --height 720 | cvlc --ffmpeg-hw -vvv stream:///dev/stdin --sout '#duplicate{dst=file{dst=/mnt/pimount/vid1.asf}}' :demux=h264

The generic start-streaming ./cam.sh bash can be:

raspivid -o - -t 9999999 -sh 55 -br 55 -vs -b 1500000 -w 1225 -h 600 --vflip | cvlc --ffmpeg-hw -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554}' :demux=h264

After a bunch of testing, about a week later it was time to test the setup at the Windjammer resort. Off we go!

Preliminary Testing at the Windjammer Resort

A couple of weeks before the big event, Bianca, Jonathon, and I drove down to Lauderdale-By-The-Sea to do some preliminary testing. There were numerous components that had to be aligned just right in order for the stream to work, from under the sea, onto the internet, live. Well, we got to the Windjammer, and we found this paradise:

Preliminary Testing – Patching into John’s Windjammer Network

First, we decided to do some network testing by patching into the already existing Earthcam Livecam ( http://www.earthcam.com/usa/florida/lauderdalebythesea/?cam=windjammer ). We added a small switch right behind the camera, and then hooked up our own testing Ethernet cabling to the existing infrastructure. This location was the control tower (the mermaid suite) from where we would control the video feed.

Here I’m setting up a directional antenna, which will point to the dive site. Initially I purchased at 5ghz antenna, after reading reviews that it can broadcast a signal farther than the 2.4ghz antenna. After some live stream testing while walking on the beach with the antenna, it turned out that even though the signal can travel up to about 10 miles out, the quality of the signal wasn’t as good as the 2.4ghz signal. Oops! Thus, I had to return the antenna (TP-LINK TL-ANT5830B 5GHz 30dBi) and the good folks at Amazon.com sent me a 2.4ghz directional antenna replacement (the TP-LINK (TL-ANT2424B 24dBi).

Here Jonathon Kerns is testing the setup, and we’re doing a dry run hooking into the existing Windjammer network to test grabbing the camera feed from the Earthcam servers.

Preliminary Testing – The Boat Network

This here is our boat network:

We’re simulating the setup as it would be when installed on the actual boat, above the event. I ended up getting a fancy Wireless N router (ASUS RT-AC66U Dual-Band Wireless-AC1750 Gigabit Router), which is a bit more powerful and professional-grade. To it, we’d be soon attaching the omnidirectional antenna (see the stick on the balcony railing), via a way too long,  TRENDnet low loss reverse SMA Female to N-Type male weatherproof connector cable. The entire setup would need to be waterproof, salt-proof, shake-proof, thunderstorm-proof, and have enough battery power on the boat for a couple of days. 

Preliminary Testing – Piggie’s Live Stream

Here we’re testing the Piggie setup, with the Raspberry Pi, the hard drives, the voltage converters and regulators, and the HD camera feed. It’s all working.

Some challenges that needed to be overcome:

  • you can’t use the RPi CPU to efficiently produce HD video, as the CPU isn’t powerful enough
  • Jonathon Kerns found a superb solution where you re-compile the VLC libraries and enable GPU support
  • the solution worked (thanks, Jonathon!) and the HD stream was very smooth, non-choppy, high quality, and acceptable for the project
  • Here’s an example of streaming using raspivid, 1.5 megabits, 1225 by 600 pixels, passed on to VLC, and then grabbed using VLC player from rtsp://127.0.0.1:8554/
raspivid -o - -t 9999999 -sh 55 -br 55 -vs -b 1500000 -w 1225 -h 600 --vflip | cvlc --ffmpeg-hw -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554}' :demux=h264

Preliminary Testing – Doom And Gloom, As Piggie Fails The Waterproof Tests

Upon further waterproof testing at depth, Piggie (the yellow camera housing) is leaking! 

Solution:
We don’t have one, we must find another way.

Preliminary Testing – Project 2 – the Ubiquiti camera

Next, Jonathon suggested that we could use his personal Ubiquiti wireless IP camera (see: Ubiquiti-Networks-AIRCAM-DOME ). We would be broadcasting over the rtsp protocol, just like with the Raspberry Pi setup.

This is the component we are talking about:


 

We used a POE (power over ethernet) switch on the server end, and a POE adapter on the camera end. It was a 48 VDC power supply, and we tested the system using various lengths of Ethernet cabling. The final test would have been to use our home-made Ethernet CAT6 cabling, encased in a high pressure air hose, patched head to head in 25 foot segments, totaling 100 feet. After numerous hours of testing and trying to get this to work with Earthcam.com, we found out that the proprietary Ubiquiti software that was installed in the camera had some major limitations. We could see the feed using VLC player and http://camera-ip:8554/ , but we could not reach the stream from Earthcam’s servers, via Comcast’s modem, the routers, and down into to the camera. I remember this being a complete nightmare, and we were stuck because of the proprietary Ubiquiti software and these limitations. Also, on top of it all, even if we managed to get this to work, we would still need a waterproof housing for this camera as well, and we wouldn’t be able to use the Piggie housing since it was leaking. Thus, it was time to move on to the next solution.
We decided that we would still be able to use the existing Raspberry Pi computer setup, with the HD camera. We just needed to come up with a waterproof housing solution.

Back in Tallahassee – Project 3 – PVC Housing

Jonathon and I decided that we’d scrap the entire Piggie project (the yellow camera housing), and build a home-made waterproof housing, to house the Raspberry Pi and its tiny HD camera. Thus, it was time to hit Home Depot.

After some careful PVC part picking, analysis, cutting, and gluing, this was the final product:

It doesn’t look like much, but it houses the Raspberry Pi computer, the HD camera, a power over Ethernet splitter, and voltage converters. The Ethernet cable comes out of the housing, and is shielded in a 100 foot long hose (Harbor Freight, high pressure air hose). I used the lighter hose, because 100 feet of it can get heavy quickly, especially once it fills up with water.
 

Back in Lauderdale-By-The-Sea

Fast forward some days, and again we’re driving from Tallahassee down to Lauderdale-By-The-Sea, for the main Allen “The Grouper” Sherrod Guinness World Record SCUBA Diving event. John Boutin of the Windjammer resort lets us set up shop there and start working on the underwater live broadcast system.

Here Allen Sherrod discusses technology with Jonathon Kerns, while Alan Lupsha discusses Marcin Michel’s scubacapsule housing (see: https://scuba-capsule.de/start/us ).
A mermaid swims in the night, at the Windjammer Resort.
Early in the morning, on Thursday, September 18th, at 6:30AM, after a bunch of interviews with the local news channels, Allen “The Grouper” Sherrod plunges into the ocean, to reclaim his world record for the longest scuba dive in saltwater.

Debugging At the Windjammer

No great things work right away, and for every spectacular omelet you have to break some eggs. I had my share of debugging issues with the entire system.

Trapped In The (Networking) Closet With Comcast For A Day

Next we’re looking at the connection between the Windjammer network, and the Internet, specifically the Comcast router.

The next problem was that it wasn’t possible to connect from Earthcam’s server, via the Internet, through the Windjammer Comcast modem, up to the camera, to grab the video feed. I ended up spending about a day in the Windjammer utility/networking closet, talking with Comcast and trying to resolve the problem. I tried both the Ubiquiti and the Raspberry Pi camera, which were broadcasting using the RTSP protocol (port 8554), and there was no way to poke through the network and establish a connection from outside to the inside. We exhausted all options. We even asked John Boutin’s friend Christian Mones for help, and he came by to see if we could resolve the issue, and we could not connect. My best guess is that this particular Comcast modem was blocking what we were trying to do.

We thus could not reach into the Windjammer network from the Internet from Earthcam, over port 8554. We even mapped this router port to higher ports, like 50554, without any success. It was a protocol block of sorts.

An Alternative – The Wowza Server

We started looking into alternative solutions to publish the camera stream to the Earthcam server. Instead of having Earthcam reach into the Windjammer network and grab the stream (which we couldn’t do due to Comcast restrictions), the alternative was to install some kind of server, grab the stream from the camera, and push the stream out to Earthcam.  I installed the Wowza streaming server (see: https://www.wowza.com/products/streaming-engine ), and messed with the trial software for a couple of hours, trying to get it to work. The result – we couldn’t get Earthcam to poke into our network and grab the stream from the Wowza server.

An Alternative – Switching from Earthcam to Ustream

I tried out Ustream.com’s software tools as an alternative to Earthcam. I installed the Ustream Windows software, grabbed the Raspberry Pi camera RTSP stream, and I was able to push this stream further to Ustream’s site, which could then further be viewed by the Internet audience. The only problem was that I was using the trial version of the software, and thus the stream would cut off after 1 hour. Also, there was a big watermark on the video stream, advertising ustream. We considered purchasing the product, just for the event, but weren’t sure it was the right solution. I decided to check with Earthcam’s team, before cutting them off completely.

The Final Solution – ffmpeg Stream Push to Earthcam

I called Earthcam and told them that we are considering switching to Ustream, since their feed was working using their Windows tools. Their engineers were very nice, and we got Mr. Juan Navas to customize the Earthcam system to accept our ffmpeg stream from the Raspberry Pi camera, from the bottom of the ocean. Guess what, this solution worked like a charm!

Instead of a pull, here we’re doing a stream push from the bottom of the ocean up to Earthcam.

The linux script which ended up passing the video stream to ffmpeg, which then pushed the stream to the Earthcam server was:

#!/bin/sh
USERNAME=windjammer
PASSWORD=secretpasswordhere
STREAMNAME=windjammerHD3.flv
BITRATE=1000000

/usr/bin/raspivid --rotation 180  --nopreview -o - -t 0 -b 1000000 -w 400 -h 300  | \
/usr/local/bin/ffmpeg -i - -vcodec copy -acodec copy -an   -metadata author=EarthCam \
-f flv "rtmp://204.107.64.58:1935/fecnetwork \
flashver=FMLE/3.0\20(compatible;\20FMSc/1.0) \
live=true \
pubUser=$USERNAME \
pubPasswd=$PASSWORD \
playpath=$STREAMNAME \
pageUrl=http://www.earthcam.com swfUrl=http://www.earthcam.com/publish.swf"  >> camlog.t

Camera Flooding

We started streaming, and streaming, and then the camera flooded. You won’t believe this. Even though the Ethernet cable was sealed very well into the housing, with plenty of silicone, at depth water would travel up the Ethernet cable, and would push down through the Ethernet wire jacket, through the tight silicone, all the way into the housing. Luckily, I added some DC-to-DC voltage regulators inside the housing, so the saltwater that was about to burn up the Raspberry Pi, only managed to burn up the voltage regulators. 

Here is the flooding:

Saltwater leaking through the Ethernet cable jacket, into the Raspberry Pi housing, to the buck converter. 
The saltwater flooding quickly burnt up some Ethernet cabling, some buck converters, and a Router port!

Camera Flooding Solution

After some analysis, I decided to give the following solution a try. I split each one of the Ethernet wires, glued them into the PVC housing, added silicon sealant, and then bunched the Ethernet wires back together. 

The saltwater flooding was stopped! As Borat would say: “great success!”

More Equipment Casualties

Due to the boat rocking back and forth in the wind, the antenna connections broke. I had to do an emergency run to all the local stores, looking for a replacement part. It took about 10 stores, and 4 precious hours, and eventually I found an (expensive) replacement cable.

Having run out of parts, I had to re-build a power over Ethernet (POE) injector manually, at 2 AM. 
This also happens to be when I had to say good bye to my Samsung Galaxy S4 phone. A tiny drop of saltwater made its way onto the phone’s motherboard, and started corroding the board. I noticed this too late, so the distilled water didn’t help much.

The Live Stream from the Bottom of the Sea

This picture says it all – a garage grade project can go a long way. (Photo from YouTube video, credits David Sirak: www.youtube.com/watch?v=WQXbNaC1U6Q ) Here I am in the back, live-streaming the feed during the National Geographic interview. Notice the orange high pressure hose, that’s housing the POE Ethernet cable. The feed is being pushed from the Raspberry Pi, using vlc and ffmpeg, up to the boat, via a router, to the omnidirectional antenna, over to the shore to the parabolic antenna, via the Windjammer routers, through the Comcast modem, up to Earthcam.com, where the stream is being watched by the Internet.

A screenshot of the live stream of Allen “The Grouper” Sherrod.
Here is Richard Black (of FloridaDiveConnection.com ), monitoring operations from the control tower (aka. the mermaid suite). On the desk is one of the Wireless N router that I hooked up to the parabolic antenna, which was right outside Richard’s control tower.
Allen “The Grouper” Sherrod emerges from the ocean, after 51 hours, 4 minutes, 28 seconds, setting a new world record saltwater SCUBA dive.

Conclusion

I’m very grateful for being given the chance to partake in this amazing event. I love inventing technology solutions, and this project had it all, a computer, Linux software, electronics, power converters, POE (power over Ethernet), routers, antennas, wiring, troubleshooting, saltwater waterproofing, manufacturing PVC housing, and many, many great people. I’d like to thank my team for helping facilitate this live feed: John Boutin, Richard Black, Jonathon Kerns, and Bianca Lupsha. I’m looking forward to the next big event!

Other Links