Created
December 10, 2012 10:18
-
-
Save dulichan/4249781 to your computer and use it in GitHub Desktop.
Take a webcam pic from linux script
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
# For this script to work following commands should be executed first | |
# yum install -y mplayer-gui | |
# yum install -y xine | |
# yum install -y vlc | |
# yum install -y mplayer | |
mplayer -tv driver=v4l2:fps=1 -vo jpeg -vf framestep=5 -frames 5 tv:// | |
if [ ! -d "right" ]; then | |
mkdir right | |
fi | |
fileName=0 | |
if [ -z "$1" ];then | |
fileName=0 | |
else | |
fileName="$1" | |
fi | |
if [-d "right/"$fileName".jpg"];then | |
rm right/"$fileName".jpg | |
fi | |
mv 00000005.jpg right/"$fileName".jpg | |
rm *.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment