Skip to content

Instantly share code, notes, and snippets.

@trickkiste
Created July 26, 2012 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trickkiste/3181569 to your computer and use it in GitHub Desktop.
Save trickkiste/3181569 to your computer and use it in GitHub Desktop.
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin
VIDEO_PATH=/home/pi/video_playlist
LOG=/var/log/playout.log
pid=
trap '[[ $pid ]] && kill $pid && echo "Signal trapped" >> $LOG && exit' TERM
echo `date` "Entering playout script" >> $LOG
export LD_LIBRARY_PATH=/opt/vc/lib:/usr/lib/omxplayer:$LD_LIBRARY_PATH
while true
do
for i in $(/bin/ls $VIDEO_PATH/*.mov); do
omxplayer.bin -o hdmi $i >> $LOG 2>&1 & pid=$!
wait
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment