Humble Pi

This blog is for my own personal use on how to set up a Raspberry Pi to auto-boot straight into an incoming RTMP stream!

Raspberry Pi 2 Installation Guide Install Raspbian

For Screen and File Sharing on a Mac On the Pi:

sudo apt-get install netatalk

Now from the Mac, open Finder, and hit ⌘K. Enter afp:// (using the IP address of your Pi). On the Pi:

sudo apt-get install avahi-daemon
sudo update-rc.d avahi-daemon defaults

Now create a file /etc/avahi/services/afpd.service (as root):

sudo vim /etc/avahi/services/afpd.service

and add this content:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
   <name replace-wildcards="yes">%h</name>

Then run this command:

sudo /etc/init.d/avahi-daemon restart

You should now be able to see the Pi in the Finder sidebar.

Setting up vncserver

On the Pi:

sudo apt-get install tightvncserver

Enter an eight character password. Now do:

cd /etc/init.d
sudo vim tightvncserver

Add the following content to the file:

# /etc/init.d/tightvncserver

# Carry out specific functions when asked to by the system
case "$1" in
    su pi -c '/usr/bin/vncserver -geometry 1440x900'
    echo "Starting VNC server "
    pkill vncserver
    echo "VNC Server has been stopped (didn't double check though)"
    echo "Usage: /etc/init.d/blah {start|stop}"
    exit 1

exit 0

(Change the geometry setting if your monitor is a different size.)

Now do:

sudo chmod +x tightvncserver
sudo pkill Xtightvnc

Check the VNC server is not running:

ps aux | grep vnc

Then do:

sudo /etc/init.d/tightvncserver start
cd /etc/init.d
sudo update-rc.d tightvncserver defaults

Finding your VNC server using Bonjour

[Source: Getting Started With Raspberry Pi] Create the avahi rfb service file:

sudo vim /etc/avahi/services/rfb.service

and add this content:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
  <name replace-wildcards="yes">%h</name>

Then run:

sudo /etc/init.d/avahi-daemon restart

Now you should be able to see the Screen Share option for the Pi in your Finder sidebar.

Update raspi-config

  • “sudo raspi-config”
  • Advanced Options > Update This

Update all packages

  • “sudo apt-get update”
  • “sudo apt-get upgrade”

Install Nginx with RTMP Module

Configure Nginx for RTMP

  • “sudo nano /usr/local/nginx/conf/nginx.conf”

REMEMBER! First line of config should read:

  • “user pi;” instead of:
  • “#user nobody;”

Then add to the bottom of the config:

rtmp {
        server {
                listen 1935;
                chunk_size 4096;

exec_push /usr/bin/omxplayer --live rtmp://;

                application live {
                        live on;
                        record off;

Start and stop Nginx

  • sudo /usr/local/nginx/sbin/nginx
  • sudo /usr/local/nginx/sbin/nginx -s stop

Edit rc.local for Nginx start-up at boot

OUTCOME: System automatically starts RTMP server at boot. RTMP Server (Nginx) detects incoming video stream via RTMP and sends data to the video player (OMXPlayer).

PROBLEM: OMXPlayer stops playing the incoming RTMP stream between 1-15 seconds, event hough RTMP incoming video has not stopped.

Things to try

Over clock?


Modest – NO AFFECT

Medium – NO AFFECT


Turbo – ?


Change GPU memory size?

Tried 64, 128 and 256. NO AFFECT

Named pipe?

  • “mkfifo /tmp/livestream”


  • “sudo apt-get install rtmpdump”
  • “rtmpdump -r rtmp:// –live -o /tmp/livestream | omxplayer /tmp/livestream”

Publishing Double Switch

Part 1 of this blog: Deconstructing Double Switch.

Part 2 of this blog: Recreating Double Switch.

Part 3 of this blog: Composing Double Switch.

Related post: Project NEMO And the Unfortunate Demise of FMV Games.

Page Divider

Having had to play the game a few times myself to figure out some timings and work out the order of a few clips, it became obvious the game has a random element to it. Each time you play the Thugs and Intruders are different. However, it appears the rooms and entry times stay the same. This gives the player a chance to remember the structure of the game, although the video elements and trigger points differ and therefore could affect the perfect run. The final video below shows every thug and every intruder (repeated several times, as they are in the game too), with both trap and non-trap versions. I hope you like the final version. It took some blood, sweat and tears.

Screen Shot 2015-08-01 at 23.51.36

Page Divider

The hope of creating such a video was to re-ignite interest in the game. I’d love to get involved with any re-release or porting, although I’m not in any way a programmer. But financially I’d love to support such a thing, should it become an Indiegogo or Kickstarter campaign.

As a quick example of how a DVD version of the game could work, I created this video. Hopefully it sparks some ideas.

The concept was great. The footage was great. The storyline and script were great. Finally, after a weeks worth of trials and tribulations, the fully rendered video is here. It shows every clip in the correct sequence in the game. It shows every occurrence of a Thug or Intruder, each with a trap and non-trap version. It didn’t come without a run of issues on my part. Missing clips, incorrect storyline order, unknown edit render errors.

Finally, I give you… Double Switch.

Page Divider

Part 1 of this blog: Deconstructing Double Switch.

Part 2 of this blog: Recreating Double Switch.

Part 3 of this blog: Composing Double Switch.

Related post: Project NEMO And the Unfortunate Demise of FMV Games.