This repo contains code for using Raspberry Pis to create low-cost, highly scalable video walls or multi-channel video installations. Setup is simple, and the software takes care of the details for you:
The Pis will talk to eachother over the network using a simple peer-to-peer protocol to figure out how to stay in sync. You can remove and add Pis while the cluster is running, and they will quickly fall into sync with the other Pis.
config.local.js
to use the filename of your video file. See
config.js
for a list of other available settings.node main.js
or use ansible.Video files should not be temporally compressed (eg. MJPEG or Apple
PRORES), or they should have a very low GOP length (the interval between
i-frames or keyframes). You can use script/get_keyframe_intervals
to
inspect the GOP of a file (depends on ffmpeg and ffprobe).
Default configuration resides in config.js. The default
configuration can be overriden by creating a config.local.js
file. See
documentation in config.js for details on each setting. The
configuration files are JavaScript to allow settings based on
calculations. This means that you need to be sure your configuration is
valid JavaScript, or the whole configuration file will be ignored.
An example config.local.js
file:
var FPS = 29.97;
module.exports = {
fps: FPS,
toleranceSecs: 1 / FPS * 3,
smoothingWindowMs: 1e3 / FPS * 15
};
Once the pis are running, you can access a control panel by opening a web browser and navigating to any of the pis using their hostnames or ips. For example, http://player-1.local or http://10.0.0.2. You can also try navigating to http://players.local, which should take you to whichever player is currently the master.
The control panel will show you the status of the pis and allow you to perform the following actions:
The control software is written in Node.js, uses OMXPlayer to play the video, and OSC to talk over the network. The controller uses a dumbed-down consensus algorithm to elect a peer as master, which all the other Pis become slaves to, syncing their video by seeking, pausing, and slightly tweaking their play speed.
To make management of the cluster easier, there is a system automation tool that uses Ansible to provision, deploy, and configure many Pis at the same time.