Last active
August 29, 2015 14:13
-
-
Save corajr/534d55c7cfea680e6ca3 to your computer and use it in GitHub Desktop.
Serve a movie file to the Raspberry Pi
This file contains hidden or 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
| put_on_tv() { | |
| IP=$(ipconfig getifaddr en1) | |
| PORT=$(($RANDOM%63000+2001)) | |
| FILENAME=$(basename "$*") | |
| FILEEXT=${FILENAME##*.} | |
| ln -s "$1" $TMPDIR/$PORT.$FILEEXT | |
| ( | |
| cd $TMPDIR | |
| python -m SimpleHTTPServer $PORT & | |
| ssh -t livingroom_pi "omxplayer -o hdmi -r http://$IP:$PORT/$PORT.$FILEEXT" | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment