1FSWEBCAM(1)                      User Commands                     FSWEBCAM(1)
2
3
4

NAME

6       fswebcam - Small and simple webcam for *nix.
7

SYNOPSIS

9       fswebcam [<options>] <filename> [[<options>] <filename> ... ]
10

DESCRIPTION

12       fswebcam  is  a  small  and  simple webcam app for *nix. It can capture
13       images from a number of different sources and perform simple  manipula‐
14       tion  on  the captured image. The image can be saved as one or more PNG
15       or JPEG files.
16
17       The PNG or JPEG image can be sent to stdio using the filename "-".  The
18       output filename is formatted by strftime.
19
20

CONFIGURATION

22   Configuration File
23       Config  files  use the long version of options without the "--" prefix.
24       Comments start with a # symbol at the beginning of the line.
25
26
27   General Options
28       -?, --help
29              Show a usage summary.
30
31
32       -c, --config
33              Load options from a file. You can  load  more  than  one  config
34              file, and can mix them with command-line arguments.
35
36              Note:  This  option  can not be used from within a configuration
37              file.
38
39
40       -q, --quiet
41              Hides all messages except errors.
42
43
44       -v, --verbose
45              Print extra information during the capture process.
46
47
48       --version
49              Print the version number and exit.
50
51
52       -l, --loop <frequency>
53              Continually capture images. The time between images is specified
54              in seconds.
55
56              Default behaviour is to capture a single image and exit.
57
58              Note:  The time to capture the next image is calculated relative
59              to the epoch, so an image will not be captured immediately  when
60              the program is first started.
61
62
63       --offset <seconds>
64              Sets  the  offset to use when calculating when the next image is
65              due in loop mode. Value can be positive or negative.
66
67
68       -b, --background
69              Run in the background. In this mode stdout and  console  logging
70              are unavailable.
71
72
73       --pid <filename>
74              Saves  the  PID of the background process to the specified file.
75              Ignored when not using background mode.
76
77
78       --log [file/syslog:]<filename>
79              Redirect log messages to a file or syslog. For example
80
81              --log output.log
82              --log file:output.log
83              --log syslog
84
85
86       --gmt  Use GMT instead of the local timezone when formatting text  with
87              strftime.
88
89
90   Capture Options
91       -d, --device [<prefix>:]<device name>
92              Set  the  source or device to use. The source module is selected
93              automatically unless specified in the prefix.
94
95              Default is /dev/video0.
96
97              Available source modules, in order of preference:
98
99              V4L2 - Capture images from a V4L2 compatible video device.
100              V4L1 - Capture images from a V4L1 compatible video device.
101              FILE - Capture an image from a JPEG or PNG image file.
102              RAW - Reads images straight from a device or file.
103              TEST - Draws colour bars.
104
105
106       -i, --input <input number or name>
107              Set the input to use. You may select an  input  by  either  it's
108              number or name.
109
110              Default is "0".
111
112
113       --list-inputs
114              List available inputs for the selected source or device.
115
116              fswebcam -d v4l2:/dev/video1 --list-inputs
117
118
119       -t, --tuner <tuner number>
120              Set the tuner to use.
121
122
123       -f, --frequency <frequency>
124              Set  the frequency of the selected input or tuner. The value may
125              be read as KHz or MHz depending on the input or tuner.
126
127
128       -p, --palette <name>
129              Try to use the specified image format when capturing the image.
130
131              Default is to select one automatically.
132
133              Supported formats:
134
135              PNG
136              JPEG
137              MJPEG
138              S561
139              RGB32
140              RGB24
141              BGR32
142              BGR24
143              YUYV
144              UYVY
145              YUV420P
146              BAYER
147              SGBRG8
148              SGRBG8
149              RGB565
150              RGB555
151              Y16
152              GREY
153
154
155       -r, --resolution <dimensions>
156              Set the image resolution of the source  or  device.  The  actual
157              resolution  used  may differ if the source or device cannot cap‐
158              ture at the specified resolution.
159
160              Default is "384x288".
161
162
163       --fps <frames per second>
164              Sets the frame rate of the capture device. This  currently  only
165              works with certain V4L2 devices.
166
167              Default is "0", let the device decide.
168
169
170       -F, --frames <number>
171              Set the number of frames to capture. More frames mean less noise
172              in the final image, however capture times  will  be  longer  and
173              moving objects may appear blurred.
174
175              Default is "1".
176
177
178       -S, --skip <number>
179              Set  the number of frames to skip. These frames will be captured
180              but won't be use. Use this option if your camera sends some  bad
181              or corrupt frames when it first starts capturing.
182
183              Default is "0".
184
185
186       -D, --delay <delay>
187              Inserts  a  delay after the source or device has been opened and
188              initialised, and before the capture begins.  Some  devices  need
189              this  delay to let the image settle after a setting has changed.
190              The delay time is specified in seconds.
191
192
193       -R, --read
194              Use read() to capture images. This can be slower but more stable
195              with some devices.
196
197              Default  is  to  use mmap(), falling back on read() if mmap() is
198              unavailable.
199
200
201       -s, --set <name=value>
202              Set a control. These are used by the source modules  to  control
203              image or device parameters. Numeric values can be expressed as a
204              percentage of there maximum range or a literal value, for  exam‐
205              ple:
206
207              --set brightness=50% --set framerate=5
208
209              Non-numeric controls are also supported:
210
211              --set lights=on
212
213              V4L2  features  a  type of control called a 'button'. These con‐
214              trols do not take any value, but trigger an action. For example:
215
216              --set "Restore Factory Settings"
217
218              Control names and values are not case sensitive.
219
220              Note: Available controls will vary depending in the source  mod‐
221              ule  and  devices used. For more information see the --list-con‐
222              trols option.
223
224
225       --list-controls
226              List  available  controls  and  their  current  values  for  the
227              selected source module and device. For example:
228
229              fswebcam -d v4l2:/dev/video2 --list-controls
230
231
232   Output Options
233       These  options  are  performed  in the order they appear on the command
234       line, only effecting images output later on the command line. For exam‐
235       ple:
236
237              fswebcam -r 640x480 output1.jpeg --scale 320x240 output2.jpeg
238
239              Will create two images, "output1.jpeg" containing a full resolu‐
240              tion copy of the captured image  and  "output2.jpeg"  containing
241              the same captured image but scaled to half the size.
242
243
244       --no-banner
245              Disable the banner.
246
247
248       --top-banner
249              Position the banner at the top of the image.
250
251
252       --bottom-banner
253              Position the banner at the bottom of the image.
254
255              This is the default.
256
257
258       --banner-colour <#AARRGGBB>
259              Set  the  colour  of  the banner. Uses the web-style hexadecimal
260              format (#RRGGBB) to describe the  colour,  and  can  support  an
261              alpha channel (#AARRGGBB). Examples:
262
263              "#FF0000" is pure red.
264              "#80000000" is semi-transparent black.
265              "#FF000000" is invisible (alpha channel is at maximum).
266              Default is "#40263A93".
267
268
269       --line-colour <#AARRGGBB>
270              Set the colour of the divider line. See --banner-colour for more
271              information.
272
273              Default is "#00FF0000".
274
275
276       --text-colour <#AARRGGBB>
277              Set the colour of the text. See --banner-colour for more  infor‐
278              mation.
279
280              Default is "#00FFFFFF".
281
282
283       --font <[file or font name]:[font size]>
284              Set  the  font  used  in the banner. If no path is specified the
285              path in the GDFONTPATH environment variable is searched for  the
286              font.  Fontconfig  names  may also be used if the GD library has
287              support.
288
289              If no font size is specified the default of "10" will be used.
290
291              Default is "sans:10".
292
293
294       --no-shadow
295              Disable the text shadow.
296
297
298       --shadow
299              Enable the text shadow.
300
301              This is the default behaviour.
302
303
304       --title <text>
305              Set the main text, located in the top left of the banner.
306
307
308       --no-title
309              Clear the main text.
310
311
312       --subtitle <text>
313              Set the sub-title text, located in the bottom left of  the  ban‐
314              ner.
315
316
317       --no-subtitle
318              Clear the sub-title text.
319
320
321       --timestamp <text>
322              Set  the timestamp text, located in the top right of the banner.
323              This string is formatted by strftime.
324
325              Default is "%Y-%m-%d %H:%M (%Z)".
326
327
328       --no-timestamp
329              Clear the timestamp text.
330
331
332       --info <text>
333              Set the info text, located in the bottom right of the banner.
334
335
336       --no-info
337              Clear the info text.
338
339
340       --underlay <filename>
341              Load a PNG image and overlay it on the image, below the  banner.
342              The image is aligned to the top left.
343
344              Note:  The  underlay is only applied when saving an image and is
345              not modified by any of the image options or effects.
346
347
348       --no-underlay
349              Clear the underlay image.
350
351
352       --overlay <filename>
353              Load a PNG image and overlay on the image, above the banner. The
354              image is aligned to the top left.
355
356              Note:  The  overlay  is only applied when saving an image and is
357              not modified by any of the image options or effects.
358
359
360       --no-overlay
361              Remove the overlay image.
362
363
364       --jpeg <factor>
365              Set JPEG as the output image format. The compression factor is a
366              value between 0 and 95, or -1 for automatic.
367
368              This is the default format, with a factor of "-1".
369
370
371       --png <factor>
372              Set  PNG  as the output image format. The compression factor can
373              be a value between 0 and 9, or -1 for automatic.
374
375
376       --save <filename>
377              Saves the image to the specified filename.
378
379              Note: This isn't necessary on the command-line where a  filename
380              alone is enough to save an image.
381
382
383       --revert
384              Revert  to  the  original  captured  image  and resolution. This
385              undoes all previous effects on the image.
386
387              Note: This only reverts the image itself, and not  options  such
388              as font, colours and overlay.
389
390
391       --flip <direction[,direction]>
392              Flips  the  image.  Direction can be (h)orizontal or (v)ertical.
393              Example:
394
395              --flip h    Flips the image horizontally.
396              --flip h,v  Flips the image both horizontally and vertically.
397
398
399       --crop <dimensions[,offset]>
400              Crop the image. With no offset the cropped area will be the cen‐
401              ter of the image. Example:
402
403              --crop 320x240    Crops the center 320x240 area of the image.
404              --crop 10x10,0x0  Crops the 10x10 area at the top left corner of
405              the image.
406
407
408       --scale <dimensions>
409              Scale the image.
410
411              Example: "--scale 640x480"  scales  the  image  up  or  down  to
412              640x480.
413
414              Note: The aspect ratio of the image is not maintained.
415
416
417       --rotate <angle>
418              Rotate the image in right angles (90, 180 and 270 degrees).
419
420              Note:  Rotating the image 90 or 270 degrees will swap the dimen‐
421              sions.
422
423
424       --deinterlace
425              Apply a simple deinterlacer to the image.
426
427
428       --invert
429              Invert all the colours in the image, creating a negative.
430
431
432       --greyscale
433              Remove all colour from the image.
434
435
436       --swapchannels <c1c2>
437              Swap colour channels c1 and c2. Valid channels are R, G and B --
438              for Red, Green and Blue channels respectively.
439
440              Example:  "--swapchannels  RB"  will swap the red and blue chan‐
441              nels.
442
443
444       --exec <command>
445              Executes the specified command and  waits  for  it  to  complete
446              before continuing. The command line is formatted by strftime.
447
448

SIGNALS

450       SIGHUP This causes fswebcam to reload it's configuration.
451
452
453       SIGUSR1
454              Causes  fswebcam to capture an image immediately without waiting
455              on the timer in loop mode.
456
457

KNOWN BUGS

459       The spacing between letters may be incorrect. This is an issue with the
460       GD library.
461
462

REPORTING BUGS

464       Please report bugs to <phil@sanslogic.co.uk>.
465
466

SEE ALSO

468        ncftpput(1), strftime(3)
469
470

AUTHOR

472       Written by Philip Heron <phil@sanslogic.co.uk>.
473
474
475
476
477fswebcam 20140113               13 January 2014                    FSWEBCAM(1)
Impressum