Knowledgebase

Home

Raspberry Pi

Autoplay video on Raspberry Pi

[from: https://rusnak.io/autoplay-video-on-raspberry-pi/]

  1. Download Raspbian Lite from raspberrypi.org
  2. Copy the downloaded image to the SD card
    1. (e.g. sudo dd if=2020-02-13-raspbian-buster-lite.img of=/dev/mmcblk0 conv=fsync,notrunc bs=4M)
  3. Boot Raspberry Pi into freshly installed Raspbian
  4. Copy your video from USB flash drive to the SD card
  5. sudo apt-get update
  6. sudo apt-get install omxplayer
  7. Append this line /usr/bin/omxplayer -b –loop /home/pi/*.mp4 to file /etc/rc.local
  8. Set the file as executable: chmod +x /etc/rc.local
  9. Reboot and enjoy!

To turn it off, I had to ssh into the raspberry pi and remove the added line from /etc/rc.local and reboot.