pwcview
—
view video, create jpeg snapshots and alter settings of a webcam
controlled by the pwc(4) driver.
The pwcview
utility is used to view the video, create
jpeg snapshots, and alter the settings of a webcam controlled by the pwc(4)
driver.
General options:
-
?
- Display help message
-h
- Run
pwcview
in headless mode (without the
gui)
-p
- Enable webcam snapshot button (only works with the FreeBSD pwc driver and
not with all cameras)
-k
- Add time date string to picture.
Device options:
-d
device
- Selects the video device to open. The default is /dev/video0
-s
size
- Sets the webcam's video size. The default is sif. Can be one of 'sqcif',
'qsif', 'qcif', 'sif', 'cif' or 'vga', for an image size of resp. 128x96,
160x120, 176x144,320x240, 352x288 and 640x480 (of course, only for those
cameras that support these resolutions).
-f
fps
- Sets the webcam's frame rate. The default is 5. Should be in the range of
5-30.
JPEG output options:
-c
count
- Number of automatic jpeg snapshots to take. Set this to -1 for unlimited
automatic jpeg snapshots. The default is 0
-i
interval
- Automatic jpeg snapshot interval in milliseconds. The default is 3000
-q
quality
- Quality of jpeg output images, range 0-100. The default is 75
-o
outfile
- Filename of the jpeg output images. This is a string that is passed to the
strftime(3) function and thus can contain the format specifiers as
documented in the strftime(3) man page. The default is
/tmp/%Y%m%d%H%M%S.jpg
-e
command
- Command to execute after each jpeg snapshot. This command will be executed
with the filename of the jpeg image as it's only command line argument. If
you want to execute a command that requires multiple arguments, you can
create a wrapper shell script. The default is not to execute any
command.
Motion detection options:
-r
- Enable motion detection recording. When this option is specified
pwcview
will write all raw YUV420P frames that
have a number of blocks with motion in them that is higher than threshold
to stdout. For this option to work you must redirect stdout to a file or
pipe it to another command (e.g. mencoder
)
-m
- Show detected motion. When this option is specified the regions in the
picture in which motion is detected are displayed in negative.
-j
command
- Command to execute when motion is detected. The default is not to execute
any command.
-g
interval
- Minimum time in seconds between motion commands. The default is 60
seconds.
-u
sensitivity
- Motion detection sensitivity. The lower you set this the more sensitive.
The default is 1000.
-t
threshold
- Motion detection threshold. The number of blocks (a block is 8x8 pixels)
that must have motion in them before any of the actions motion record,
motion fullscreen or motion beep is taken. The default is 1.
-l
frames
- Recording margin. The number of extra frames that are written to stdout
after the last frame that had motion in it. The default is 15.
Video display options:
-x
- Create window without frame
-y
- Use IYUV overlay instead of YV12 overlay
-z
- Create the video surface in system memory (SDL_SWSURFACE)
-a
- Always use video surface (SDL_ANYFORMAT)
-b
bpp
- Bits per pixel to setup video surface with. The default is 0, which means
to use the current display bits per pixel.
pwcview
can also detect motion in the webcam's image and
write the frames with motion in them to stdout so you can for example encode
them with mencoder
to MPEG4.
Sometimes it can be useful to exclude some areas in the picture
from motion detection. With pwcview
you can use the
m key to enter motion mask editing mode. In motion
mask editing mode you can add areas to exclude from motion detection with
the mouse. In motion mask editing mode masked areas are displayed in
negative.
To add an area to the motion mask: move the mouse pointer to the
top left position of the area that you want to exclude and left click then
move your mouse pointer to the bottom right position of the area that you
want to exclude and left click again. You can repeat this as many times as
you want.
To remove areas from the motion mask do the same but this time use
the right mouse button. To clear the entire mask press the middle mouse
button.
You can save the motion mask with the w key.
Each time pwcview
starts it will look for the mask
file in the current directory and automatically load it.
To leave motion mask editing mode press the
m key again.
Besides the keys used for the menu system the following keys can be used:
- f
- Toggle fullscreen mode.
- p
- Take a manual jpeg snapshot.
- q
- Quit the application.
- m
- Enter/leave motion mask editing mode.
- w
- Saves motion mask to pwcview.msk in current directory.
- space
- Freeze/unfreeze picture.
With pwcview
you can alter various settings of your
webcam. It provides a menu like structure where you specify what setting you
want to alter with the up arrow and down
arrow. The current menu item and thus the setting to alter will then be
displayed in the title bar.
The following settings of the webcam can be altered:
- framerate
- Use the left arrow and right
arrow to change the webcam's frame rate.
- brightness
- Use the left arrow and right
arrow to change the webcam's brightness.
- contrast
- Use the left arrow and right
arrow to change the webcam's contrast.
- saturation
- Use the left arrow and right
arrow to change the webcam's saturation.
- gamma
- Use the left arrow and right
arrow to change the webcam's gamma.
- gain control
- Use the enter key to switch between auto and manual
gain control. Use the left arrow and
right arrow in manual mode to change the webcam's
gain control.
- shutter speed
- Use the enter key to switch between auto and manual
shutter speed. Use the left arrow and
right arrow in manual mode to change the webcam's
shutter speed.
- white balance
- Use the enter key to switch between auto, manual,
indoor, outdoor and fluorescent white balance. Use the
left arrow and right arrow in
manual mode to change the webcam's red gain and blue gain.
- contour
- Use the enter key to switch between auto and manual
contour. Use the left arrow and
right arrow in manual mode to change the webcam's
contour.
- dnr mode
- Use the enter key to switch between the webcam's
various modes of dynamic noise reduction.
- backlight compensation
- Use the enter key to switch the webcam's backlight
compensation on/off.
- anti flicker mode
- Use the enter key to switch the webcam's anti
flicker mode on/off.
- color mode
- Use the enter key to switch the webcam to color or
black and white mode (FreeBSD only)
- compression
- Use the left arrow and right
arrow to change the webcam's compression level.
- save user settings
- Use the enter key to save the current webcam
settings to the webcam's EEPROM.
- restore user settings
- Use the enter key to load the current webcam
settings from the webcam's EEPROM.
- restore factory settings
- Use the enter key to load the current webcam
settings from the factory defaults.
- led on
- Use the left arrow and right
arrow to change the webcam's led on time.
- led off
- Use the left arrow and right
arrow to change the webcam's led off time.
The following settings of pwcview can be altered:
- time date string
- Use the enter key to toggle the addition of a time
date string to the picture. (command line equivalent -k)
- scaling
- Use the enter key to switch between none, double and
full scaling.
- motion record
- Use the enter key to enable/disable motion recording
(command line equivalent -r)
- motion fullscreen
- Use the enter key to enable/disable going to full
screen mode when motion is detected.
- motion beep
- Use the enter key to enable/disable the speaker beep
when motion is detected.
- motion show
- Use the enter key to toggle the display of motion in
negative (command line equivalent -m)
- motion command interval
- Use the left arrow and right
arrow to change the motion command interval (command line equivelant
-g)
- motion sensitivity
- Use the left arrow and right
arrow to change the motion detection sensitivity (command line
equivalent -u)
- motion threshold
- Use the left arrow and right
arrow to change the motion detection threshold (command line
equivalent -t)
- recording margin
- Use the left arrow and right
arrow to change the recording margin (command line equivalent
-l)
pwcview
uses the SDL library to display the video of
your webcam. The default video mode used by pwcview
is
in general the most efficient, but this is very much dependent on the
capabilities of your video card. If it doesn't quite work the way you want it
to, you can tune the video settings with any of the command line options
listed in the "Video display options" section at the beginning of
this man page. See the SDL_SetVideoMode(3) man page for exact details.
Set the webcam to vga mode at 15 fps and execute the firefox command whenever a
jpeg snapshot is taken:
pwcview -s vga -f 15 -e firefox
Take one automatic jpeg snapshot image using the default sif
resolution, save it as foo.jpg and then exit:
pwcview -h -c 1 -o foo.jpg
Run pwcview in headless mode with the webcam set to 320x240@15fps,
add a time date string to the picture, write the frames in which motion is
detected to stdout and encode them with mencoder to motion.avi:
pwcview -hkr -s sif -f 15 | mencoder -demuxer
rawvideo -rawvideo fps=15:w=320:h=240:i420 - -ovc lavc -lavcopts
vcodec=mpeg4 -o motion.avi
The Linux PWC Documentation Project:
http://www.lavrsen.dk/twiki/bin/view/PWC/WebHome
pwc(4), SDL_SetVideoMode(3), strftime(3)
This is free software licensed under the GPLv2; There is NO warranty; not even
for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Copyright (C) 2006-2007 Raaf