Building a Video Kiosk with Ubuntu Core

Building a Video Kiosk with Ubuntu Core

by April 23, 2020

In this post we’ll show you how to create a video kiosk using Ubuntu Core.

In our last post we installed Ubuntu Core on Raspberry Pi. If you haven’t already read that post you may want to, because for this post we will be assuming you have Ubuntu Core already installed on a Raspberry Pi.

Before we get too far, let’s explain what we mean by a video kiosk. For our purposes a “kiosk” is a single purpose device with a screen (potential a touch screen). For example a screen at the airport showing departure times is a kiosk. Or you may have seen screens in a restaurant showing their menu; that would be a kiosk too. So a video kiosk is a kiosk that plays a video (or videos).

Step 0: Before You Start

Before you get started you will need the following:

  1. A Raspberry Pi with Ubuntu Core Installed (see our post about installing Ubuntu Core on Raspberry Pi)
  2. A Screen with an HDMI input (this could be a monitor or a tv screen)
  3. A selection of videos files you want to play on your kiosk
  4. An internet connection

Make sure that your Raspberry Pi is connected to the monitor and the internet, and make sure that the Pi and monitor are powered on.

Step 1: Installation

For this setup you will only need to install two snaps. These snaps are mir-kiosk and mpv-kiosk. Mir is a display server, and this snap packages it specifically for creating kiosk applications. In other words mir is responsible for displaying images on the screen. Mpv-kiosk is a snap built by us at Farstack. It packages the video player mpv for use as a kiosk. It will play videos in a loop indefinitely.

To install theses snaps ssh into your Raspberry Pi and run the following commands:

sudo snap install mir-kiosk
sudo snap install --edge mpv-kiosk

Step 2: Add Videos

Mpv-kiosk will look for videos in two locations. First in /var/snap/mpv-kiosk/common/ and then in any usb storage devices (found in /media/). Setting up removable media to work properly is out of the scope of this tutorial, so we’ll use the common directory.

To add videos to your kiosk follow these steps. Download the videos to your laptop. Copy the videos over to the Raspberry Pi using scp. Then, ssh into the pi and move the files into the common directory. Restart mpv-kiosk.

Here are the commands you’ll run. Obviously your ip address will probably be different, and you’ll want to replace video.mp4 with the actual video files you want to copy.

scp video.mp4
mv video.mp4 /var/snap/mpv-kiosk/common/
snap restart mpv-kiosk

And your done! Hopefully at this point your see your video playing on your monitor.

Below you can see the entire process.