Py Live Cam

Setup for a Raspberry Pi live camera with Python.

Based on the Raspbian Jessy image:

For the VGA Hat check the modifications here:

Some Mods

Remove the splash screen:

$ sudo nano /boot/cmdline.txt



Enable camera:

$ sudo raspi-config

enable camera

Disable camera light:

sudo nano /boot/config.txt


# Disable camera light

Install some software:

$ sudo apt-get install git htop cmake

Install Python Modules

$ sudo apt-get update

Install Pip:

$ sudo apt-get install python-pip

Install python picamera:

$ sudo apt-get install python-picamera

Install python omxplayer:
Python OMXPlayer

Python Live Cam

$ mkdir picam
$ cd picam

Download the program:

autostart: /etc/rc.local

shutdownbutton (pin 22): /home/pi/pictures_of_an_exhibition/

camera: /home/pi/pictures_of_an_exhibition/

Network configuration

SD card read-only

Set the SD card to a read-only mode.
Read-Only SDcard

HDMI settings

Check the current HDMI state:

$ tvservice -s

List of CEA supported modes:

$ tvservice –m CEA

List of DMT supported modes:

$ tvservice –m DMT

Choose the prefered mode, DMT work best with HDMI beamer and monitors.
CEA is hdmi_group=1
DMT is hdmi_group=2

Open config file:

$ sudo nano /boot/config.txt

change for example CEA 720p:


Low level changes for DMT 640×480 60 Hz would be:


All modes are on:

Change H264 to mp4

$ sudo apt-get install gpac
$ MP4Box -add filename.h264 filename.mp4