webcam2caps

Reads camera frames data products from URL and pushes it to a CAPS server.

Description

Read camera images from a website and push them into a CAPS server.

Use the input.address to configure the base url of a website providing webcam images.

https://www.geonet.org.nz:443/volcano/cameras/latest

Then use the input.streamsFile to map the individual images to stream ids.

# Comments and empty lines are ignored

NZ.RAOU..CAM    raoulisland.jpg
NZ.TEKA..CAM    tekaha.jpg
NZ.WHAK..CAM    whakatane.jpg
NZ.TONG..CAM    tongariro.jpg

This will fetch images from

https://www.geonet.org.nz:443/volcano/cameras/latest/raoulisland.jpg

https://www.geonet.org.nz:443/volcano/cameras/latest/tekaha.jpg

… and so on.

By default an HTTP Referer header with the origin of input.address is sent with each request. Some websites (for example SpotAzores) enforce hotlink protection and only return live images when the Referer matches their site. Override the header with input.referer, or set it to none to disable it.

Use output.timeout to bound how long a CAPS push may block when the server is unreachable. A short TCP preflight checks reachability first; the actual push runs in a worker process that is killed after the timeout if CAPS Plugin.push blocks in C++. Image fetching continues and the next interval retries CAPS.

Module Configuration

etc/defaults/global.cfg
etc/defaults/webcam2caps.cfg
etc/global.cfg
etc/webcam2caps.cfg
~/.seiscomp/global.cfg
~/.seiscomp/webcam2caps.cfg

webcam2caps inherits global options.

Note

Modules/plugins may require a license file. The default path to license files is @DATADIR@/licenses/ which can be overridden by global configuration of the parameter gempa.licensePath. Example:

gempa.licensePath = @CONFIGDIR@/licenses

Note

input.* Configuration of data input.

input.interval

Default: 60

Unit: s

Type: uint

Range: 1..inf

Time interval to fetch data.

input.address

Default: https://www.geonet.org.nz:443/volcano/cameras/latest

Type: url

Host URL. Format: [http|https]://host[:port]/baseURL

input.referer

Type: string

HTTP Referer header sent with image requests. By default the origin of input.address is used (scheme://host/). Some sites require a same-origin Referer (hotlink protection). Set to "none" to disable the header.

input.streamsFile

Default: @ROOTDIR@/share/webcam2caps/streammap

Type: directory

File where stream ids are matched to a specific webcam path.

Note

output.* Configuration of data output host.

output.address

Default: caps://localhost:18003

Type: url

URL. Format: [caps|capss]://[user:pass@]host[:port]

output.baseDir

Default: /tmp/webcam

Type: directory

Directory for temporary storage of images.

output.timeout

Default: 10

Unit: s

Type: uint

Range: 1..inf

Timeout in seconds for the CAPS TCP preflight and for killing a hung push worker process. If CAPS is unreachable or Plugin.push blocks, the push aborts after this time instead of hanging forever.

Command-Line Options

Generic

-h, --help

Show help message.

-V, --version

Show version information.

--config-file file

The alternative module configuration file. When this option is used, the module configuration is only read from the given file and no other configuration stage is considered. Therefore, all configuration including the definition of plugins must be contained in that file or given along with other command-line options such as --plugins.

-D, --daemon

Run as daemon. This means the application will fork itself and doesn’t need to be started with &.

Verbosity

--verbosity arg

Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug.

-v, --v

Increase verbosity level (may be repeated, e.g., -vv).

-q, --quiet

Quiet mode: no logging output.

--print-component arg

For each log entry print the component right after the log level. By default the component output is enabled for file output but disabled for console output.

--component arg

Limit the logging to a certain component. This option can be given more than once.

-s, --syslog

Use syslog logging backend. The output usually goes to /var/lib/messages.

-l, --lockfile arg

Path to lock file.

--console arg

Send log output to stdout.

--debug

Execute in debug mode. Equivalent to --verbosity=4 --console=1 .

--trace

Execute in trace mode. Equivalent to --verbosity=4 --console=1 --print-component=1 --print-context=1 .

--log-file arg

Use alternative log file.

Input

--address str

Overrides configuration parameter input.address.

--referer str

Overrides configuration parameter input.referer.

--streams str

Overrides configuration parameter input.streamsFile.

Output

-a, --addr str

Overrides configuration parameter output.address.

--timeout str

Overrides configuration parameter output.timeout.