Basic button operated video player

Button operated video player.

Just after suggestions as to the simplest way to play a few video clips that are selected via pushing a button.

There are a lot of media players for the Pi out there, but all serious over kill for this project.

Don’t need any screen menus…. just boot into a default clip and then use a button to select another video clip.

Hardware is a Pi3b, touch 7” screen and 4 push button switches

Any tips appreciated.

1 Like

Hi Bruce,

For something really simple I’d suggest simply installing OMXPlayer then setting up a bash script which you call from .bashrc or similar to run on boot which simply listens for a button press in a loop then just call whatever file/s you’d like to play through OMXPlayer, there are plenty of discussions and tutorials online demonstrating how to run a command on button press from the Raspberry Pi in a bash script which should be pretty easy to get set up:

(By the way, if omxplayer isn’t supported in your OS because you’re running Bullseye etc. there are plenty of other command line media players you could use instead such as mplayer)

If you have any questions about it (or would like to show off your set up once you’ve got it working for others to read through :smile:) feel free to make another post here.

– Bryce

Look like you need a Legacy OS as OMXplayer is dropped from the current pi OS?

You can get some clues from the following links:

I’ve configured this … eo-player/
as suggested and found I needed to use a legacy version of the Pi OS as OMXplayer is not supported in the current release.
Everything sets up fine but when I run the example command line ‘vidlooper --no-autostart --splash /home/pi/splash.png --no-loop --countdown=5 --video-dir /home/pi/videos’ I get the following:

pi@raspberrypi:~ $ vidlooper --countdown 5 --no-loop --video-dir /home/pi/videos
rpi-vidlooper starting in 1 seconds (Ctrl-C to abort)…Traceback (most recent call last):
File “/home/pi/.local/bin/vidlooper”, line 10, in
File “/home/pi/.local/lib/python3.7/site-packages/rpi_vidlooper/”, line 279, in main
File “/home/pi/.local/lib/python3.7/site-packages/rpi_vidlooper/”, line 84, in init
for f in sorted(os.listdir(video_dir))
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/pi/videos’
Exception ignored in: <function VidLooper.del at 0x76501348>
Traceback (most recent call last):
File “/home/pi/.local/lib/python3.7/site-packages/rpi_vidlooper/”, line 196, in del
if not self.debug:
AttributeError: ‘VidLooper’ object has no attribute ‘debug’
pi@raspberrypi:~ $

My four video MP4 files are in the ‘/home/pi/videos’ directory etc.

I’m really not sure what to do now apart from forgetting this method and switching to the current OS and adding some code (to emulate the next (n key) and previous (p key)) in VLCplayer.

Would be nice to have separate buttons to select the video clip rather than use the forward button and reverse button) but not essential.

I’ve just used this in conjunction VLC player, and all seem good… … om-folder/

Then added this to allow for button toggling of “N” next track and “P” for previous….


1 Like

I’m running vidlooper at an Aviation Museum where I have four buttons, with the first button showing all three videos and the other three buttons selecting the individual videos. Also use indicator LEDS to show which video is currently running.
I access vidlooper through a Bash script that runs in rc.local:
/home/pi/Museum/ --video-dir /home/pi/Videos --restart-on-press --gpio-pins 26:21,19:20,13:16,6:12,11:7
However, I have tried to use vidlooper for more than four videos and it doesn’t work - video selection is random. Still trying to sort that one out.