A colleague recently asked me if I thought the Raspberry Pi could be used as the basis for a low-cost digital signage solution, and having thought about it for a few minutes it actually seemed like it could be a very good fit. The Raspberry Pi’s HDMI output allows it to display high-definition video and audio on an ordinary television display, and while it may not easy to render HTML5 or display PDF documents without using X Windows it is relativly simple to get the Raspberry Pi to play video content from the command line using omxplayer.

To create and edit video content I’d suggest using something like kdenlive which is a free open source video editing tool for linux. However, as it requires a something with a bit more horsepower than the Raspberry Pi, you will need a decent PC to run it. I found it relatively easy to use and it has some very useful features, including the ability to import images and them view them by panning around and zooming in.

Note – The above text should all be on one line. Do not change the values on your system for ‘root’ or ‘rootfstype’.

Disable Console Logins

To prevent the console from displaying a login prompt and to stop users logging in we need to modify inittab, commenting out the two lines shown below to disable the normal virtual consoles that would be shown on the screen and enabling the serial console by inserting the line shown in the next section.

Then download the latest installation package from the omxplayer website and install it using dpkg.

# wget -c 'insert link to download here'
# dpkg -i omxplayer*.deb

To have omxplayer start automatically when the system boots you need to modify inittab. In the example below the video will be played continuously using the HDMI audio output.

# vi /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
while true; do# For analogue audio output uncomment the following line#omxplayer -b -o local /home/video.mpeg# Alternatively to use the HDMI audio output uncomment the following line.omxplayer -b -o hdmi /home/video.mpegdone
exit 0

Note – Since the script in rc.local never exists you will not be able to login on the console. Use SSH instead if needed or rather than play the video directly use a seperate script.