1webcam(1) General Commands Manual webcam(1)
2
3
4
6 webcam - capture images and upload them to a webserver using ftp
7
9 webcam [ config file ]
10
12 webcam captures images from a video4linux device like bttv, annotates
13 them and and uploads them to a webserver using ftp in a endless loop.
14
16 At startup webcam reads the configuration from the given config file or
17 ~/.webcamrc if none is specified in the command line.
18
19 The config file has at least two sections. The "grab" section holds
20 the capture parameters. Any other section describes where the image
21 should be uploaded. Older versions used "ftp" as name for that sec‐
22 tion. Recently the webcam utility got support for multiple connec‐
23 tions, thus any section name is accepted and you can have more than one
24 ftp section (you have to use another name for each section througth,
25 name them by upload servers for example).
26
27 Here is an sample config file (the given values are the defaults):
28
29 [grab]
30 device = /dev/video0
31 text = "webcam %Y-%m-%d %H:%M:%S"
32 infofile = filename
33 fg_red = 255
34 fg_green = 255
35 fg_blue = 255
36 width = 320
37 height = 240
38 delay = 3
39 wait = 0
40 input = composite1
41 norm = pal
42 rotate = 0
43 top = 0
44 left = 0
45 bottom = -1
46 right = -1
47 quality = 75
48 trigger = 0
49 once = 0
50
51 [ftp]
52 host = www
53 user = webcam
54 pass = xxxxxx
55 dir = public_html/images
56 file = webcam.jpeg
57 tmp = uploading.jpeg
58 passive = 1
59 debug = 0
60 auto = 0
61 local = 0
62 ssh = 0
63
64 The annotation text is processed with strftime. Check the strftime(3)
65 or date(1) manpage to see how you can format the timestamps. The text
66 can also be read from a extern file (use infofile for that). The
67 default color for the text overlay is white (RGB=255,255,255). Entries
68 in the range of 0 through 255 for fg_red, fg_green, and fg_blue can be
69 used to define a different color. Likewise bg_red, bg_green, and
70 bg_blue can be used to set the background color (which defaults to
71 transparent).
72
73 input is the video source (TV/composite/whatever), norm the TV norm.
74 delay is the delay between two images in seconds. wait is the initial
75 delay before the first image is grabbed (some cameras need some time
76 for adapting to lightning, thus don't return images with reasonable
77 quality within the first few seconds ...). quality is the JPEG quality
78 for the stored images.
79
80 top, bottom, left, and right in the grab section allow cropping the
81 image after it is grabbed. They should satisfy 0<=top<bottom<=height
82 and 0<=left<right<=width. (0,0 is the top, left corner.) If rotate is
83 positive, the output image will be rotated counter-clockwise 90 degrees
84 that number of times (1, 2, or 3).
85
86 With trigger set to a non-zero value webcam will upload the image only
87 if the content of the image has changed. It just looks for the maximum
88 difference between the last uploaded and current image and if it is
89 greater than the specified value the image will be uploaded. If once
90 is set to 1 webcam will upload a single frame and quit.
91
92 archive can be used to create a (local) archive of the webcam images.
93 Just specify the filename for the files as argument. The filename will
94 be processed with strftime(3), so you can use the place the usual time
95 format controls into the string to get unique filenames. Non-existing
96 directories are created if needed.
97
98 If debug in the ftp section is set to 1 the complete communication
99 between webcam and the ftp utility is printed to stderr. auto enables
100 autologin via ~/.netrc (starts the ftp utility without the '-n' switch,
101 check the ftp(1) man page for more info about the ~/.netrc file). If
102 local in the ftp section is non-zero, files will be stored locally
103 (using the dir, tmp, and file parameters) rather than ftped. ssh set
104 to non-zero makes webcam use ssh instead of ftp.
105
107 contributed by Frederic Helin, the parameters belong into the [grab]
108 section of the config file too.
109
110 distor = 1
111 If distor param is set to 1, the correction of distortion works.
112
113 distor_k = 700
114 This is the coefficient of distortion. This algorithm is based
115 on the paper "Correcting Distortion of Image by Image Registra‐
116 tion" of Toru Tamaki, Tsuyoshi Yamamura and Noboru Ahnishi. More
117 your lens has an important distortion, more 'distor_k' must be
118 neared of 0. 700 is the default value. Coefficient k of program
119 is x100 than article.
120
121 distor_cx = 192
122
123 distor_cy = 144
124 Coordinates of the lens optical axis: width/2 and height/2 are
125 the default values. The axis doesn't go through the image cen‐
126 ter. So, you can change its coordinates around the center of
127 image to affine correction.
128
129 distor_zoom = 30
130 Zoom parameter is used to cache the distorted borders of image,
131 if you don't like this. Default value is 100.
132
133 distor_sensorw = 320
134
135 distor_sensorh = 240
136 Dimensions of camera sensor. Default values are for 1/4p sensor.
137 This parameters used to have the same k coefficient than arti‐
138 cle.
139
141 Gerd Knorr <kraxel@bytesex.org>
142
144 Copyright (C) 1997-2002 Gerd Knorr
145 This program is distributed in the hope that it will be useful, but
146 WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
147 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
148
149
150
151 (c) 1998-2000 Gerd Knorr webcam(1)