OVERVIEW

vgrabbj purpose is to read data from a v4l-device and put it in a file, formatted as jpeg, png, or pnm. Except for the ftp-options described below everything can also handled on the commandline. Here the configuration statements are described.

Syntax is <keyword> <value>. Comments start with a ';' or '#'. Those lines are ignored by vgrabbj. Case of the keywords and named options doesn't matter except for the timestamp option as well as any filename.

The configuration file is parsed line by line. If any keyword appears twice or more often, the last one is the one used.

On startup, the pre-defined configuration file /etc/vgrabbj.conf is read. Then, commandline parameters are evaluated one by one, the last is the most significant, if one option is provide twice or more often. Same applies for the commandline parameter -c <config-file>.

GENERAL OPTIONS

DaemonSeconds seconds

Daemonize & loop with seconds intervals (min. 1).

Daemon microseconds

Daemonize & loop microseconds intervals (min. 1). Same as -l except you can control it more precisely.

AutoBrightness On|Off

Defines if vgrabbj's brightness adjustment is used. This option works only if the device supports data fetch via read and RGB24 videopalette. See ForcePalette on how-to set RGB24. Some device do not support RGB24, hence, Brightness is ignored.

ImageQuality quality

Sets the quality of a jpeg output to quality (1-100, default: 75).

ImageSize imagesize

Sets the imagesize of input device, where imagesize is one of:

  •  sqcif= 128x96,     qsif = 160x120,
     qcif = 176x144,    sif  = 320x240,
     cif  = 352x288,    vga  = 640x480,
     svga = 800x600,    xga  = 1024x768,
     sxga = 1280x1024,  uxga = 1600x1200,
    
  • (default: cif)

ImageWidth width

Sets the width of the image to width. Needs -H. The v4l-device has to support the image width you set with this option.

ImageHeight height

Sets the height of the image to height. Needs -w. The v4l-device has to support the image height you set with this option.

OutputFormat format

Sets the output to format (either jpeg, png, or pnm, default: jpeg). Alternative, you may provide jpg for jpeg.

OutputFile <filename>

Output is written to filename (default: /dev/stdout)

Archive <path/filename>

Additional output is written to path/filename (default: not set), whereas the path-filename can include any strftime component. The path- filename must not be on a different filesystem as the output defined above. Additionally, you need to take care of the number of files stored. There is no upper ceiling for archiving.

VideoDevice <device>

Sets the input device to device (default: /dev/video)

OpenOnce On|Off

Defines if vgrabbj opens the device only while image data is grabbed (Off) or keeps it opened while it is running (On). Setting it to Off is helpful if you need access to the device besides vgrabbj. This use is discouraged though, due to possible problems with memory fragmentation. Default is On.

SetImageSize On|Off

Defines if the image size (see -i, -H, and -w) of the device is set by vgrabbj. Necessary for certain v4l-devices which do not support to be set to a particular image size (e.g. IBM-usb-cam, QuickCam). For these devices you have to specify the size at module load time. Default is On.

SwitchColor On|Off

Switches colormap from BGR to RGB (or vice versa) if set to On. Default is Off. Use if you have odd colors.

SwapRL On|Off

Swaps left and right of the image like a mirror. Default: Off. is Off.

SwapTB On|Off

Swaps top and bottom of the image like a mirror. Default: Off. is Off.

NoUseMmap On|Off

Turns off the use of mmap'ed (better) memory allocation for grabbing frames. Some (very rare) cams cannot use mmap'ed memory and have to use read. If you want to switch easily, use this switch. If you don't know what I'm talking about, leafe it like it is: Default is Off.

DebugLevel value

Sets the loglevel of vgrabbj. Valid for value are 0, 2, 3, 4, 6, 7 (default: 4). 0 means no messages at all, 7 is debug. Don't use 7 if you are running vgrabbj in daemon mode, it'll surely fill your syslog. Be aware, that loglevel 7 will also post you ftp-password (if defined) in the logfile!

UseTmpOut On|Off

Sets the use of the temporary outputfile. Default is On. Ignored in case the default output (/dev/stdout) is used. If set to Off, the data is written directly to the file defined by OutputFile.

If filename is different from /dev/stdout (given via -f parameter or OutputFile, vgrabbj defaults to use a temporary file called filename.tmp to write the image. This file is then renamed to filename to shorten the time period corrupt data may be read from filename.

Exec commands

Ask vgrabbj to launch an external program. May be used to pass the picture through ImageMagick or others filters. The first '%s' instance in the command line will be replaced with filename. If UseTmpOut is On, commands will be run before the file is renamed.

ForcePalette palette

Force the usage of the specified palette. If palette is not supported by either vgrabbj or the v4l-device, fallback to a palette supported by both is provided. If no common denominator is available, vgrabbj exits. Supported palettes are marked with * below. Possible values are (copy from videodev.h):

  •  1  VIDEO_PALETTE_GREY      Linear greyscale
     2  VIDEO_PALETTE_HI240     High 240 cube (BT848)
     3  VIDEO_PALETTE_RGB565    565 16 bit RGB
     4 *VIDEO_PALETTE_RGB24     24bit RGB
     5 *VIDEO_PALETTE_RGB32     32bit RGB
     6  VIDEO_PALETTE_RGB555    555 15bit RGB
     7 *VIDEO_PALETTE_YUV422    YUV422 capture
     8 *VIDEO_PALETTE_YUYV
     9 *VIDEO_PALETTE_UYVY
     10*VIDEO_PALETTE_YUV420
     10 VIDEO_PALETTE_YUV411    YUV411 capture
     11 VIDEO_PALETTE_RAW       RAW capture (BT848)
     12 VIDEO_PALETTE_YUV422P   YUV 4:2:2 Planar
     13 VIDEO_PALETTE_YUV411P   YUV 4:1:1 Planar
     14*VIDEO_PALETTE_YUV420P   YUV 4:2:0 Planar
     15 VIDEO_PALETTE_YUV410P   YUV 4:1:0 Planar
     16 VIDEO_PALETTE_PLANAR
     17 VIDEO_PALETTE_COMPONENT
    
  • (no default, depends on v4l-device).

DiscardFrames value

value images are grabbed and immediately discarded. Only the last image is written to the output. This might be helpful if your v4l-device needs to take a couple of images to auto-adjust to the current light.

ARCHIVE OPTIONS

The following options are useful if you want to keep a certain amount of images in an archive. Currently, the archive is only supported if kept on the same filesystem as the images taken.

Archive <archive-filename-pattern>

The archive-filename-pattern is evaluated as a timestring, hence the same applies as to TimeStamp (see below, default: /tmp/arch/cam-%Y-%d-%m-%H-%M-%S.jpg)

ArchiveEach <value>

Defines how many images have to be taken before a copy is made for the archive. E.g. if defined 1, each image is put in the archive; if defined 5 every fifth image is put in the archive.

ArchiveMax <value>

Sets the maximum number of images to be put in the archive.

TIMESTAMP OPTIONS

The following options are available only if vgrabbj was compiled with the freetype library available. The timestamp will only be enabled if all values evaluated (inlcuding defaults) lead to a valid configuration and UseTimestamp is set to On.

UseTimestamp On|Off

This is the essential setting to enable timestamps if defined in the config file. Without this being set to On, it just won't work (although, if there are options set to have an invalid configuration, it won't work either). This is different to the handling on the commandline.

FontFile filename

The TrueType font to be used for the timestamp (default /usr/X11R6/lib/X11/fonts/TrueType/Arialn.ttf).

FontSize size

Set the fontsize to size for timestamp (3-100, default: 12).

TimeStamp format-str

Defines the timestamp. format-str can be plain text or any strftime format. Any '""' at the beginning or the end will be eliminated for compatibility reasons, i.e. they are not necessary (default: "%a, %e. %B %Y - %T" - see strftime(3) for details).

Position value

Alignment of the timestamp in the image. Possible value:

  • ul = upper left,    ur = upper right,
    ll = lower left,    lr = lower right,
    uc = upper center,  lc = lower center
    
  • (default: upper right). You can use either the short or the long version.

Blend value

Defines the blend between font background and image (1-100, default: 60).

BorderSize value

value pixels will be used as border around the timestamp string (1-255, default: 2).

FTP OPTIONS

There are no options for ftp-upload on the command line. This is due to the need to provide a password which would be visible via the ps(1) command.

EnableFtp On|Off

Ftp-Connection will only be opened if set to On. Be aware that this might bring up a dial-up connection. See also KeepAlive. (default: Off)

RemoteHost hostname

Host to which a ftp-connection will be established everytime an image has been written (see also: Daemon, DaemonSeconds, KeepAlive, default: camimage.jpg).

RemoteDir path

The path consists of the full path on the remote host defined by RemoteHost (default: /).

RemoteImageName filename

The filename consists of the full path and filename on the remote host defined by RemoteHost (default: foo.bar.com).

Username username

The name of the user to log on the remote ftp-server (default: foo).

Password password

The password of the user to log on the remote ftp-server (default: bar). Be aware, that the password is kept unencrypted in memory, it might be read by others.

KeepAlive On|Off

If set to On, the connection will be kept. This will cause a dial-up line to be up all the time, which in turn may cost a lot of money! If set to Off, the connection will be established after an image was written to the OutputFile. After transmission, the ftp-connection will be ended. This may also result in phone charges, for which Author takes no responsibility. See License.

Passive On|Off

If set to On, passive ftp will be used. This can help connecting to ftp servers from the inside of a NAT-ed network.

TryHarder On|Off

Not implemented, yet.

HARDWARE SETTINGS

With the following options you may alter the settings of your hardware (the cam), if supported by the cam. Be aware, this might break your hardware, as there are no checks if the values supplied are valid, allowed, or supported!

-W <value>

Whiteness definition.

-r <value>

Color definition.

-x <value>

Contrast definition.

-b <value>

Brightness definition.

-u <value>

Hue definition.

BUGS

At my own machine running vgrabbj, the %F in a Archive-Filename causes memory corruption. This is not validated by any other machine. No further bugs are known at this time.

RELATED TO vgrabbj.conf…

AUTHOR

This manual page was originally written by Michael Janssen <[email protected]>, for the Debian GNU/Linux system and enhanced by Jens Gecius <[email protected]>.