VideoKiosk

Shamelessly copied from Alexa Steinbruck

With a RasPi up and running on network where SSH works, and a video file named /home/pi/video.mp4

 
sudo apt-get install omxplayer
sudo apt-get install screen 
sudo nano /etc/init.d/videoloop
sudo chmod 755 /etc/init.d/videoloop

The content of the videoloop file is:

#!/bin/bash
### BEGIN INIT INFO
# Provides: omxplayer
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Displays video file in a loop using omxplayer
# Description:
### END INIT INFO

# Video (replace with the path and file name of your video)
video_path=/home/pi/video.mp4

#---- There should be no need to edit anything below this line ----

# Start displaying the video loop
case "$1" in start)
screen -dmS videoloop sh -c "omxplayer -o both $video_path -b --loop --no-osd"
echo "Video Playback Started"
;;

# Stop displaying video loop
stop)
sudo killall omxplayer.bin
echo "Video Playback Stopped"
;;

# Restart video loop if it died
repair)
if !(ps -a | grep omx -q)
    then
    screen -dmS videoloop sh -c "omxplayer -o local $video_path -b --loop --no-osd"
    echo "The Video is now running"
fi
;;

*)

echo "Usage: /etc/init.d/videoloop {start|stop|repair}"

exit 1

;;
esac

Test the player with:


/etc/init.d/videoloop start
/etc/init.d/videoloop stop
/etc/init.d/videoloop repair

If it all works, add it to the startup

sudo update-rc.d videoloop defaults

and reboot!