Skip to content

Instantly share code, notes, and snippets.

@dulichan
Created December 10, 2012 10:18
Show Gist options
  • Save dulichan/4249781 to your computer and use it in GitHub Desktop.
Save dulichan/4249781 to your computer and use it in GitHub Desktop.
Take a webcam pic from linux script
# 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