Posted in Raspberry Pi

Compile FFMPEG for Raspberry Pi 3

Get FFMPEG source code:

Compile libx264

Compile ALSA

Compile FDK-AAC

Installing build tools:

Compile fdk-aac

Compile FFMPEG

--enable-omx --enable-omx-rpi : This enables ffmpeg runtime hardware encoding

Posted in Raspberry Pi

From Zero to Raspberry Pi Zero

I was pretty eager to try out Raspberry Pi Zero after their recent addition of Camera connector in v1.3 version. Luckily I got hold of a Raspberry Pi Zero from Adafruit last week and here goes my setup..

One pain-point in setting-up Raspberry Pi Zero is its needed accessories (mini HDMI-to-HDMI, micro USB OTG cable etc, power cable, monitor, keyboard, mouse, wifi dongle etc..also RPi Zero doesn’t come with USB hub built-in as in its elder bigger brother Rasperry Pi 3) to get it up and running. Thanks to this great article by Andrew, now we can setup RPi Zero as a USB gadget so that I can simply SSH into it from my Macbook via USB.

  1. Once SD card is flashed with latest Raspbian Jessie Lite image (Jessie full works equally good) , open up the boot partition Finder/Windows Explorer on your Mac/PC and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
  2. Open up the cmdline.txt. Be careful, each parameter is seperated by a single space (it does not use newlines). Insert modules-load=dwc2,g_ether after rootwait.
  3. Thats it ! Now hook-up RPi zero to Macbook/PC with micro-USB to USB cable and you can ssh into as


Setting up WiFi dongle

Edit sudo nano /etc/wpa_supplicant/wpa_supplicant.conf as follows:

Mounting USB drives

Type sudo blkid to identify the drive id.

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: