...In Which We Triumph Over Barcraft Streaming Woes
We just finished up a Barcraft at Pluckers here in Austin, and I thought I'd do a post on the video issues we had and the goofy hack I pulled together to make the technical side work.
Before all the text, here are some shiny pictures:
Note: All those familiar with Barcraft / Starcraft skip the next few paragraphs.
<barcraft:summary>
If you are unfamiliar with a Barcraft, it's simply a group of awesome nerds getting together to watch an eSports event. What means eSports? It's competitive video gaming with cash prizes, sponsorships, professional video gamers, etc. Yes, it's real, yes it's gaining popularity, and yes, it's geeky. As geeky as watching competitve poker, chess, or, in my opinion, some of the "traditional" sports.
At any rate, it is possible (although rare) for a player to become so good at certain video games that they can play it full time, enabled by sponsorships and tournament winnings. See this site to see the winnings of some of the best Starcraft players, and remember this doesn't include salaries paid by the team / sponsors.
Starcraft is a complicated strategy game, something like real time Risk + chess where the pieces can shoot each other. In summary, you gather resources to build up an army to defeat an opponent's army.
Anyway, we get a big group of people together to watch the larger tournaments.
</barcraft:summary>
Pluckers is a great place for a Barcraft -- lots of TVs, a bar, a dining area, and a patio. Everyone loves wings, and most people love a fried Twinkie. So when the Barcraft outgrew the last location, Andrew (our tireless leader and the producer of a Starcraft documentary) pulled strings and now we have room for nearly 300 people for the biggest events.
However...
As I assume is common at sports bars, Pluckers does not have a well-engineered A/V solution. Approximately two thirds of the televisions are wired to use the same composite (old-school RCA / standard definition) source, but the other televisions support either HDMI or VGA, and have to be hooked up individually. Some of them are just inaccessible.
At the last Barcraft, this limitation wasn't known in time to try to fix it. So, to support all the televisions for the ~250 people who showed up, we had four or five laptops, each streaming from the MLG live site, hooked up to the various "clumps" of televisions. This meant that the streams were anywhere between 5 and 45 seconds apart, and we saturated the Plucker's network and had terrible buffering problems, usually during the best parts of the games.
The situation remained the same as this Barcraft approached, so I tried a number of different solutions. I tried wireless HDMI transmitters, but the consumer ones were garbage and renting a decent system was over $600. I looked into HDMI -> cat5e systems, but the pricing was similar and we would have had network cables and HDMI splitters all over the place.
Finally, I decided we could just "re-stream" the screen contents of a single computer streaming from the live site. The other laptops would then "re-broadcast" the internal stream, ensuring the majority of the traffic occurs within the internal network. Additionally, the televisions all show the exact same source, and are mostly synced (at least within half a second or so).
Recipe for Successful Hackery
If you find yourself in a similar situation, here are the technical bits to recreate my setup. You're going to need a few ingredients:
- A "source" laptop / computer (for these instructions, running Ubuntu Linux, but you can do it with Mac and probably Windows as well)
- One or more "destination" laptops hooked up to televisions, projectors, what have you.
- VLC installed on every machine.
- FFMPEG installed on the "source" laptop (optional, but the way I prefer)
- All laptops connected to the same network, via wired connections.
- We tried wireless for a while, but get enough people using smartphones and laptops within the same space and you are asking for interference, dropped frames, and artifacts.
If you are following closely, and have Ubuntu on your "source" box, run the following command to install the necessary pieces:
sudo apt-get install vlc ffmpeg pavucontrol
Once that's complete, you can drop the following script contents into a file called "screenshare.sh" (or whatever you want):
You'll need to run chmod a+x screenshare.sh so you can execute it, and change any parameters to tweak the output quality. If you are video savvy, you'll notice I'm doing a high(ish) bitrate MPEG2 stream instead of an H.264 stream. The reason for this is that if you are streaming from a web site, it is 99.9% likely to be H.264, and 99.9% likely to be through Flash. (note: I just completely made up those numbers.) Watching H.264, especially through Flash, and especially at HD / high quality, is already utilizing a fair chunk of your system's resources -- I decided that throwing a fast-but-large MPEG2 stream down the internal network was just a smarter choice. Feel free to argue, and post your improvements in the comments if you are awesome.
Note that you can certainly accomplish this on Mac (and probably Windows), and you might not even need ffmpeg. I like to control all aspects of the stream, and ffmpeg is my buddy for life, so this is how I rolled.
Once you have that set up, simply run ./screenshare.sh on the "source" laptop and you should see ffmpeg printing out framerates, bitrates, etc. Now, armed with the IP address of your "source" laptop, go to each "destination" laptop, open VLC, click Media -> Open Network Stream... and enter rtsp://10.10.10.10:5544/stream in the URL field, replacing 10.10.10.10 with the IP address of your source computer.
After a few seconds, you should have marvelous 720p video streaming, nearly synced, to all of your devices. Note that this isn't terribly scalable -- in the end, we had a total of four laptops streaming (and a few mobile phones, oddly enough) and the network handled it beautifully, but your results may vary depending on what you are doing. (It is not advised to download torrents during this process. :))
The End
Anyway, that's the long and short of it. We had a blast, had 100-something people show up, and once we got the kinks worked out, the stream was solid. We still need to work out some quality issues (I hate streaming 720p only to end up with half the televisions showing standard definition), and obviously it would be nice to not have to deal with any of this. However, until Pluckers upgrades its A/V system, this should work nicely for us.
Let me know if you find this useful, or if you have improvements / issues getting it to work.
Shoutout to Mothership, a new gaming-centered store in Austin, and SteelSeries for sponsoring this month's Barcraft. Also to Andrew, who does all the real work and toils without rest to ensure we all have an awesome Barcraft experience.


