I have 2 FOSCAM HD IP camera and 1 UBNT airVision (old model) IP camera which are used for surveillance monitoring. Storage of images is done on the camera's itself, so I only needed something to view the live feeds of the camera's combined an a single screen. I had an old HDMI screen laying around and the Raspberry Pi 3 is yet the perfect (inexpesive fit) for this purpose.

Getting started

Install the standard debian Raspberry Pi and make sure to select console mode. We do need any GUI, since we will be using omxplayer to display the camera feeds. Also find out your RTSP streaming URLs.

Display camera images

I use the daemontools framework, since it provides me with logging, monitoring, restarting out-of-the-box. I also like the way his way of thinking, to avoid reinventing the wheel everytime you need to write an deamon.


WWW: - webcampi @ rustdam

/etc/service/camera1 	=	Hooiberg (via 'Rustdam Stal') - Main View
/etc/service/camera2	=	Receptie (via wired and proxied on - Left bottom
/etc/service/camera3	=	Stal	(wireless connected to - rdr at 


exec 2>&1
exec omxplayer --threshold 0 --win 0,0,1280,720 --live 'rtsp://USER:PASSWORD@IP:PORT/videoMain'


exec 2>&1
exec omxplayer --threshold 0 --win 739,720,1280,1024 --layer 10 --live 'rtsp://USER:PASSWORD@IP:PORT/videoMain'


exec 2>&1
exec omxplayer --threshold 0 --win 0,720,540,1024 --layer 10 --live 'rtsp://USER:PASSWORD@IP:PORT/videoMain'

Monitoring of camera feeds


# Quick to deal with omxplayers which are in deadloop,
# detection based on low-CPU usage
for PID in `pgrep omxplayer.bin`; do
  PCPU=`ps -p $PID -o pcpu=`
  if echo $PCPU 2.0 | awk '{exit $1<$2?0:1}'; then
    echo "Lets kill pid $PID"
    kill -KILL $PID


*  *    * * *   root    /root/ | logger

Rsyslog issues

My log was flooding with messages like this:

Jun  5 10:08:31 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Mon Jun  5 10:10:01 2017 [try ]

Looking at the RaspberryPi Forum it was caused by messages not being read from file:/dev/xconsole To fix this edit file:/etc/rsyslog.conf and comment out the block sending the entries:

        *.=notice;*.=warn       |/dev/xconsole

Remote monitoring of screen output

For debugging I remotely need to be able to look at the screen to see what is displayed. This is done by using raspi2png to grep the output of the display and present then using Apache.

Compile and install raspi2png

$ mkdir src; cd src $ git clone $ cd raspi2png $ sudo make install

Install webserver

$ sudo apt-get install apache2 $ sudo chown -R pi:pi /var/www/html

Generate display content


 <meta charset="UTF-8"> 
 <meta http-equiv="refresh" content="10">

<img src="snapshot.png" width="100%" height="100%">

Include screen capture


*	*	*	*	*	pi /usr/bin/raspi2png -p /var/www/html/snapshot.png 2>&1 | logger -t raspi2png


Open your browser and look at http://raspberrypi/

Last modified 7 years ago Last modified on 06/05/17 08:26:35
Note: See TracWiki for help on using the wiki.