Created
March 10, 2013 19:30
-
-
Save LongHairedHacker/5130022 to your computer and use it in GitHub Desktop.
omxplayer script for raspberry pi with better signal handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OMXPLAYER_BIN="/usr/bin/omxplayer.bin" | |
OMXPLAYER_LIBS="/opt/vc/lib:/usr/lib/omxplayer" | |
FBSET="/bin/fbset" | |
if [ -e $FBSET ]; then | |
DEPTH2=`fbset | head -3 | tail -1 | cut -d " " -f 10` | |
if [ "$DEPTH2" == "8" ]; then | |
DEPTH1=16 | |
elif [ "$DEPTH2" == "16" ]; then | |
DEPTH1=8 | |
elif [ "$DEPTH2" == "32" ]; then | |
DEPTH1=8 | |
else | |
DEPTH1=8 | |
DEPTH2=16 | |
fi | |
fi | |
LD_LIBRARY_PATH=$OMXPLAYER_LIBS:$LD_LIBRARY_PATH $OMXPLAYER_BIN "$@" & | |
OMXPID=$! | |
#echo $OMXPID > /tmp/omxplayer.pid | |
trap "kill $OMXPID" INT TERM | |
wait | |
if [ -e $FBSET ]; then | |
fbset -depth $DEPTH1 && fbset -depth $DEPTH2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment