Linux/Webcam

From Omnia
Jump to navigation Jump to search

General Setup

Webcam Setup - ArchWiki - https://wiki.archlinux.org/index.php/Webcam_Setup

motion

Install

yum:

yum install motion  # in external repo like FusionRPM

apt:

apt-get install motion

manual:

wget "http://sourceforge.net/projects/motion/files/latest/download?source=files" -O motion.tar.gz
tar -zvxf motion.tar.gz
cd motion-*
./configure --prefix=/opt/motion
make
sudo make install
sudo ln -s /opt/motion/etc /etc/motion

fswebcam

Install

manual:

yum install gd-devel
git clone http://github.com/fsphil/fswebcam
cd fswebcam
# OR
wget http://www.firestorm.cx/fswebcam/files/fswebcam-20140113.tar.gz
tar -zvxf fswebcam-20140113.tar.gz
cd fswebcam-20140113
./configure --prefix=/opt/fswebcam
make
sudo make install

Usage

/opt/fswebcam/bin/fswebcam -d /dev/video0 test.jpg
/opt/fswebcam/bin/fswebcam -d /dev/video0 -r 640x480 test.jpg

Start 3 frames in: (fixes an issue on some cameras)

/opt/fswebcam/bin/fswebcam -d /dev/video0 -S 3 test.jpg

Use a different palette: (fixes an issue on some cameras)

/opt/fswebcam/bin/fswebcam -d /dev/video0 -p YUYV test.jpg

Time Stamp

# default
/opt/fswebcam/bin/fswebcam -d /dev/video0 --timestamp "%Y-%m-%d %H:%M (%Z)" test.jpg
# with seconds
/opt/fswebcam/bin/fswebcam -d /dev/video0 --timestamp "%Y-%m-%d %H:%M:%S (%Z)" test.jpg