adafruit / pi_video_looper

Application to turn your Raspberry Pi into a dedicated looping video playback device, good for art installations, information displays, or just playing cat videos all day.
GNU General Public License v2.0
469 stars 244 forks source link

pi_video_looper

An application to turn your Raspberry Pi into a dedicated looping video playback device. Can be used in art installations, fairs, theatre, events, infoscreens, advertisements etc...

Works right out of the box, but also has a lot of customisation options to make it fit your use case. See the video_looper.ini configuration file for an overview of options.

If you miss a feature just post an issue here on Github. (https://github.com/adafruit/pi_video_looper)

Currently only the Legacy version of Raspberry Pi OS Lite is supported.
The last working image is this one: https://downloads.raspberrypi.com/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2022-01-28/2022-01-28-raspios-buster-armhf-lite.zip

If you need to run this image on PI 3A+ you need to add newer firmware files after the flashing. Download firmware files from here and copy all the fixup.dat and start.elf from the boot folder of the zip to the boot folder of your SD card (overwriting existing files)

For a detailed tutorial visit: https://learn.adafruit.com/raspberry-pi-video-looper/installation
There are also pre-compiled images available from https://videolooper.de (but they might not always contain the latest version of pi_video_looper)

Changelog

new in v1.0.19

v1.0.18

new in v1.0.17

new in v1.0.16

new in v1.0.15

new in v1.0.14

new in v1.0.13

new in v1.0.12

v1.0.11

new in v1.0.10

new in v1.0.9

new in v1.0.8

new in v1.0.7

new in v1.0.6

new in v1.0.5

new in v1.0.4

new in v1.0.3

new in v1.0.2:

new in v1.0.1:

How to install

sudo apt-get install git
cd ~
git clone https://github.com/adafruit/pi_video_looper
cd pi_video_looper
sudo ./install.sh

Default player is omxplayer. Use the no_hello_video flag to install without the hello_video player (a bit faster to install):
sudo ./install.sh no_hello_video

How to update

An update is always like a fresh installation so you will loose custom changes made to the /boot/video_looper.ini

For backing up the current ini:
sudo cp /boot/video_looper.ini /boot/video_looper.ini_backup

For the update:
cd ~
sudo rm -rf pi_video_looper
git clone https://github.com/adafruit/pi_video_looper
cd pi_video_looper
sudo ./install.sh

Features and settings

To change the settings of the video looper (e.g. random playback, copy mode, GPIO control, advanced features) edit the /boot/video_looper.ini file, i.e. by quitting the player with 'ESC' and logging in to the Raspberry with an attached keyboard, or remotely via ssh. Then edit the configuration file with sudo nano /boot/video_looper.ini.

Alternatively insert the SD card into your computer and edit it with your preferred text editor.

copymode explained:

By default, the looper plays any video files from a USB drive in alphabetical order. With copymode, you only need a USB drive once, to copy the video files directly onto the RPi's SD card. Once enabled in the video_looper.ini, all files from an attached USB drive are copied onto the RPi. A progress bar shows you, well, the progress of the operation.

To protect the player from unauthorised access you need to create a file on the drive called "videopi". The extension doesn't matter. This file acts as a password. (The wording of this "password" can be changed in the video_looper.ini)

You might also want to decide if new files on the drive should replace existing files or get added. "Replace" means that any existing videofiles on the RPi get deleted, and only the new files remain.
This setting can be overruled by placing a file named "replace" or "add" on the drive.
The default mode is "replace".

Note: files with the same name always get overwritten.

notable things:

Control

The video looper can be controlled via keyboard input or via configured GPIO pins. Keyboard control is enabled by default via the keyboard_control setting in the video_looper.ini file.

keyboard commands:

The following keyboard commands are active by default (can be disabled in the video_looper.ini):

GPIO control:

To enable GPIO control you need to set a GPIO pin mapping via the gpio_pin_map in the control section of the video_looper.ini. Pins numbers are in "BOARD" numbering - see: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio. Bridge a mapped pin with a Ground pin to trigger it.

The pin mapping has the form: "pinnumber" : "action”. The action can be one of the following:

Here are some examples that can be set:

For your convenience, these exact mappings can be easily enabled by uncommenting the example line in the video_looper.ini. You can also define your own mappings.

Note: to be used as an absolute index the action needs to be an integer not a string. Note 2: "keyboard_control" needs to be enabled in the ini for gpio to utilise keyboard commands.

Troubleshooting: