Skip to main content

Raspberry Pi GPIO-controlled video looper

Project description

rpi-vidlooper

A video looper for the Raspberry Pi, controlled by GPIO pins. Designed to run an unattended video display, where users can select the active video by switch.

MIT licensed.

Features

  • Play videos using OMXplayer, a hardware- assisted video player for smooth playback.
  • Switch between 2 or more videos using hardware switches wired to the Raspberry Pi's GPIO pins.
  • Optionally, indicate the active video by LED. This can be used with arcade-style switches which have built-in LEDs, or separate ones.
  • Callback-based, rather than polling-based. This means that button presses should always be acted upon.
  • Thread locking, to avoid issues when buttons are pressed rapidly and the video hasn't finished loading yet.

Usage

On the hardware side, you'll need a Raspberry PI with several switches, one for each video. Each switch should be connected to a GPIO pin, and to ground. Optionally, you can set up an indicator LED for each video, connected to a GPIO pin.

Install dependencies:

sudo apt-get update
sudo apt-get install python3-pip omxplayer

Install rpi-vidlooper:

pip3 install rpi-vidlooper

This creates the vidlooper command. For usage help, see:

vidlooper --help

Troubleshooting

RuntimeError: No access to /dev/mem. Try running as root!

By default, you'll need to run sudo vidlooper, to gain access to the GPIO pins and the graphics card (GPU) for omxplayer. Generally, this is not recommended.

To avoid this, the user you want to run the vidlooper as will need to be in the gpio group. For example, for the pi user, you'd need to do this:

sudo usermod -a -G gpio pi

See further information on this issue.

No rights to /dev/vchiq

See the OMXplayer troubleshooting to fix this issue. It's also possible to avoid by running sudo vidlooper, but as above, this is not recommended.

Further reading

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpi_vidlooper-0.2.1.tar.gz (21.4 kB view details)

Uploaded Source

File details

Details for the file rpi_vidlooper-0.2.1.tar.gz.

File metadata

  • Download URL: rpi_vidlooper-0.2.1.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for rpi_vidlooper-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ce6e72e44b26e58281c403bf84af48d6ddcff69ef89b84af90cff65c0042edf7
MD5 0f060889a34030f5df1150d841de13e4
BLAKE2b-256 095555d994f14fe36d0ee1250a11b177e7a01534a0951e1036c60f8db778f975

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page