1: Added support for images. Program calls fbi for displaying images. Duration for images is given in file name. For example nature_photo.20.jpg is displayed for 20 seconds.
2: Added html support. Htm, html and php files are opened in Chromium. Duration for web page is is given in file name. Forexample web_page.300.html is displayed 300 seconds.
Notes: Use sudo to run startvideo.sh. Requires omxplayer, pqiv, fbi and chromium.
3: Added auxiliary script WegPageToImage whick can be used to take a screenshots of web pages.
./WebPageToImage.sh webpagelist.txt /output/dir/
Automatically play and loop fullscreen videos on a Raspberry Pi 2 or 3.
This system uses a basic bash script to play videos with omxplayer, it simply checks if omxplayer isn't running and then starts it again. This simple method seems to work flawlessly for weeks on end without freezing or glitches. The only caveat of this method is that there are approximately 2-3 seconds of black between each video. If you are looking to do something with gapless looping on Raspberry Pi, try Slooper by Matthias Dörfelt, though currently it needs a few updates to work without a remote (as of May 15, 2016).
There is a videolooper written in python that uses omxplayer by Adafruit, but unfortunately on testing looping videos for more than a day it froze (as of May 15, 2016).
The script will look for videos either in:
- the
video
directory in the home directory of the pi user - a usb stick plugged in before startup (this will not be remounted if you pull it out and plug it back in)
Copy the prebuilt img to a micro SD card using these instructions. The img was setup using the steps below and 2016-05-10-raspbian-jessie-lite
was used as the base raspbian image.
Start with a raspbian img, install it on the pi, and follow the steps below to install the videolooper.
sudo apt-get update
sudo apt-get -y install omxplayer
sudo mkdir -p /mnt/usbdisk
sudo echo \"/dev/sda1 /mnt/usbdisk vfat ro,nofail 0 0\" | sudo tee -a /etc/fstab
mkdir /home/pi/video
cd /home/pi
wget https://raw.githubusercontent.com/timatron/videolooper-raspbian/master/startvideo.sh
chmod uga+rwx startvideo.sh
echo \"/home/pi/startvideo.sh" | tee -a /home/pi/.bashrc
sudo raspi-config
- Select option: "3 Boot Options"
- Select option: "B2 Console Autologin"
sudo raspi-config
- Select option: "1 Expand Filesystem"