Live Stream Your Pets with Linux and YouTube!

Embedding the Stream

Not long ago, YouTube made a change so that every time a live stream starts, it gets its own embed code. That means if you simply use the "share" button on the live stream to get the embed code, it will work only for that current streaming session. For me, that means the next day it would show a recording of the previous day, but not the live stream. I'll be honest, that quiet change was very frustrating! Thankfully, there is a way to embed the actual live stream, so that any time you start live streaming, it becomes active—that's where the Channel ID you got earlier comes in.

Here is the embed code for my live stream at http://birds.brainofshawn.com">:


<iframe width="1280" height="720"
 ↪src="https://www.youtube.com/embed/live_stream?channel=
↪UCbUTB3bVg3cmeyJUtUC9DPA&autoplay=1" frameborder="0"
 ↪allowfullscreen></iframe>

Obviously, you'll need to make the changes for your own channel, but it should be clear what the various things mean. I stuck with the 720p size even on my embedded page. Since this is embed code, you don't have to put it on its own page like I did; you could embed a tiny resolution version on your blog, for instance.

Setting up the live stream through YouTube is nice for several reasons. One, your bandwidth requirements don't change even if you have 10,000 viewers. Also, since it's YouTube, you can "cast" the video to a television or Chromecast device and show off your channel to your friends. I still hope to get more cameras and maybe set up camera rotation on multiple bird feeders, but for right now, I couldn't be happier. Enjoy!

______________________

Shawn Powers is a Linux Journal Associate Editor. You might find him on IRC, Twitter, or training IT pros at CBT Nuggets.