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 ) feel free to make another post here.
I’ve configured this https://www.vanderbilt.edu/thewondry/so … 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/vidlooper.py”, line 279, in main
File “/home/pi/.local/lib/python3.7/site-packages/rpi_vidlooper/vidlooper.py”, 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/vidlooper.py”, line 196, in del
if not self.debug:
AttributeError: ‘VidLooper’ object has no attribute ‘debug’
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…
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/vidlooper.py --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.
And you can get our latest projects and tips straight away by following us on: