| Linux / Unix Command: webcam |
NAME
webcam - capture images and upload them to a webserver using ftpSYNOPSIS
webcam [ config file ]DESCRIPTION
webcam captures images from a video4linux device like bttv, annotates them and and uploads them to a webserver using ftp in a endless loop.CONFIGURATION
At startup webcam reads the configuration from the given config file or ~/.webcamrc if none is specified in the command line. The config file has at least two sections. The "grab" section holds the capture parameters. Any other section describes where the image should be uploaded. Older versions used "ftp" as name for that section. Recently the webcam utility got support for multiple connections, thus any section name is accepted and you can have more than one ftp section (you have to use another name for each section througth, name them by upload servers for example). Here is an sample config file (the given values are the defaults):[grab] device = /dev/video0 text = "webcam %Y-%m-%d %H:%M:%S" infofile = filename fg_red = 255 fg_green = 255 fg_blue = 255 width = 320 height = 240 delay = 3 wait = 0 input = composite1 norm = pal rotate = 0 top = 0 left = 0 bottom = -1 right = -1 quality = 75 trigger = 0 once = 0 [ftp] host = www user = webcam pass = xxxxxx dir = public_html/images file = webcam.jpeg tmp = uploading.jpeg passive = 1 debug = 0 auto = 0 local = 0 ssh = 0The annotation text is processed with strftime. Check the strftime(3) or date(1) manpage to see how you can format the timestamps. The text can also be read from a extern file (use infofile for that). The default color for the text overlay is white (RGB=255,255,255). Entries in the range of 0 through 255 for fg_red, fg_green, and fg_blue can be used to define a different color. Likewise bg_red, bg_green, and bg_blue can be used to set the background color (which defaults to transparent). input is the video source (TV/composite/whatever), norm the TV norm. delay is the delay between two images in seconds. wait is the initial delay before the first image is grabbed (some cameras need some time for adapting to lightning, thus don't return images with reasonable quality within the first few seconds ...). quality is the JPEG quality for the stored images. top, bottom, left, and right in the grab section allow cropping the image after it is grabbed. They should satisfy 0<=top
CORRECTION OF DISTORTION
contributed by Frederic Helin, the parameters belong into the [grab] section of the config file too.- distor = 1
- If distor param is set to 1, the correction of distortion works.
- distor_k = 700
- This is the coefficient of distortion. This algorithm is based on the paper "Correcting Distortion of Image by Image Registration" of Toru Tamaki, Tsuyoshi Yamamura and Noboru Ahnishi. More your lens has an important distortion, more 'distor_k' must be neared of 0. 700 is the défault value. Coefficient k of program is x100 than article.
- distor_cx = 192
- distor_cy = 144
- Coordinates of the lens optical axis: width/2 and height/2 are the default values. The axis doesn't go through the image center. So, you can change its coordinates around the center of image to affine correction.
- distor_zoom = 30
- Zoom parameter is used to cache the distorted borders of image, if you don't like this. Default value is 100.
- distor_sensorw = 320
- distor_sensorh = 240
- Dimensions of camera sensor. Default values are for 1/4p sensor. This parameters used to have the same k coefficient than article.
Important: Use the man command (% man) to see how a command is used on your particular computer.

