A simple video player for Raspberry Pi controlled by a physical button connected via GPIO.
This project implements a video player that runs on Raspberry Pi and is controlled by a physical push button. The player uses GPIO pin 10 to detect button presses and plays a video file when the button is pressed. A long press (more than 5 seconds) will reboot the Raspberry Pi.
- Physical button control via GPIO
- Video playback using MPV player
- Long press detection for system reboot
- Simple and lightweight implementation
- Raspberry Pi (any model with GPIO)
- Python 3
- Physical push button
- Jumper wires for GPIO connection
- Install system dependencies:
sudo apt install python3-mpv python3-tk- Install Python dependencies:
pip install -r requirements.txt- Connect a push button to GPIO pin 10 (physical pin 19) and GND
- Place your video file as
video.mp4in thesrc/directory - Run the player:
python3 src/player.py- Press the button to play the video
- Long press (5+ seconds) to reboot the system
button-videoplayer/
├── src/
│ ├── player.py # Main player script
│ └── video.mp4 # Video file to play
├── ejemplos/ # Example scripts
├── doc/ # Documentation
├── requirements.txt # Python dependencies
└── README.md
Connect a push button between:
- GPIO pin 10 (physical pin 19)
- GND (any ground pin)
The button uses a pull-down resistor configuration.
Fernando Ortega Gorrita (@fernandoog)
See LICENSE file for details.