Posted in Raspberry Pi

Youtube Live streaming using Raspberry Pi

This blog describes how to stream video + audio to Youtube Live events using Raspberry Pi. There are lot of sites online that describe how to Live stream a webcam video to Youtube with Raspberry Pi but no where I found working solution for live streaming both Audio & Video to Youtube. Hence this blog..

Bit of background:

I work for a non-profit organization that needed a free 24/7 webcam streaming. They were using VLC in tandem with Quicktime broadcasting for last 10 yrs that worked great until the recent advent of new HTML5 and Mobile platforms. It became obsolete especially due to its need for Quicktime browser plugin and lack of support for Mobile platforms.

After some research, Youtube Live events came out to be the only free streaming solution. Initially I tried using Adobe Flash Live encoder to live stream to Youtube but its a User-interface driven tool and not a fire-and-forget type solution. This where Raspberry Pi fit the job.

Raspberry Pi 2: a tiny, cheap yet savory unix box


Needed components:

  1. Raspberry Pi 2 or 3
  2. SD card to load Raspbian OS
  3. Camera component
  4. WiFi adapter (only if its Raspberry Pi ver 2. WiFi & Bluetooth are built-in to Raspberry Pi from ver 3+)
  5. USB Audio adapter
  6. USB Micro-phone
  7. Power adapter
  8. Raspberry Pi case (optional)
  9. Keyboard, Mouse, HDMI cable, Monitor.  This is optional and only needed until you setup SSH. Alternatively, you can use this cool PiBakery project to burn SSH and WiFi info directly into your SD card thus avoiding needs for initial peripherals to boot up RPi.

Here is the command that works to stream both Audio and Video:

Key points:

  1. You need to install the ffmpeg onto your RPi in order use above script. I’ve detailed its setup in my blog here.
  2. For some reason, Audio starts falling behind the Video after about 20 mins. To give better user experience, I setup a Cron job to re-start above ffmpeg script code every 20 mins. Since Youtube does DVR of your live streaming, users won’t notice any difference.

Here is its screenshot:


5 thoughts on “Youtube Live streaming using Raspberry Pi

  1. I just like the valuable information you provide in your articles.
    I’ll bookmark your blog and test once more here frequently.
    I am moderately sure I’ll be told lots of new stuff proper right here!
    Good luck for the following!

  2. Pretty nice post. I just stumbled upkn your blog and wished
    to say that I’ve truly enjoyed browsing your blog posts. After all I will
    be subscribing too your rss feed and I hope you write again very

  3. I absolutely love your blog and find most of your post’s
    to be what precisely I’m looking for. Do you offer guest writers to write content in your case?
    I wouldn’t mind composing a post or elaborating on a lot of
    the subjects you write in relation to here. Again, awesome

  4. Greetings from Los angeles! I’m bored to tears at work so I decided to check out your website on my iphone during lunch break.
    I enjoy the knowledge you provide here and can’t wait to take a look when I get home.
    I’m surprised at how quick your blog loaded on my phone ..
    I’m not even using WIFI, just 3G .. Anyways, awesome site!

Leave a Reply

Your email address will not be published. Required fields are marked *