For the complete documentation index, see llms.txt. This page is also available as Markdown.

Photo Capture Plugin

Purpose

The purpose of this plugin is to capture an image from locally connected cameras.

Usage

Cameras connected via a local ethernet network are sometimes referred to as IP or WEB cameras. Most IP/WEB connected cameras allow photo and/or video collection by common protocols such as http, fswebcam or rtsp. The site https://www.ispyconnect.com/sources.aspx can be used to determine if and how a camera image can be captured from a particular make and model of camera, via http, fswebcam or rtsp. The file defined in config_filename (see Arguments below) must contain a single command that is used get the photo, and 4 command types are currently supported by this plugin, either http, rtsp, fswebcam or ffmpeg. The command must start with either of these keywords. Comments are allowed in the config filename, but must start with '#'. Some examples of the contents of config_filename:

http://root:password@192.168.1.2/cgi-bin/viewer/video.jpg
ffmpeg -y -rtsp_transport tcp -i rtsp://admin:password@192.168.1.100:554/live -vframes 1 
fswebcam -d /dev/video0 -r 640x480 --jpeg 100 -S 20 --set brightness=40% -F 1  

If collecting via rtsp, then installation of the ffmpeg command must be done manually, as below, if its not already installed. If ffmpeg is not installed, do the following on an X86 device.

sudo apt-get update
sudo apt-get install -y libav-tools
ffmpeg -version

For testing, try and capture an image to the filename /tmp/img.jpg, try the following:

ffmpeg -y -rtsp_transport tcp -i rtsp://admin:admin@192.168.10.113:554/live -vframes 1 /tmp/img.jpg

Capturing an image via http is much easier. The convert tool is optional, and only to reduce the size of the image if it is too big.

sudo apt-get update
sudo apt-get install -y imagemajick
wget -O /tmp/temp.jpg http://<uid>:<pwd>@192.168.0.23/jpg/image.jpg?size=3 && convert /tmp/temp.jpg -resize 650 /tmp/photo1.jpg
wget -O /tmp/photo1.jpg http://<uid>:<pwd>@192.168.0.23/jpg/image.jpg?size=3

You may have to encode the password using this guide: https://www.w3schools.com/tags/ref_urlencode.ASP if it contains special characters. For example; A password of (say) ()&^% becomes: %28%29%26%5E%25.

At the moment, the plugin WILL NOT setup the WATCH scenario in the Ardexa YAML file. This MUST be done manually. An example is shown below. If you don't know how to do this, contact Ardexa.

Ardexa does not recommend USB connected cameras. However if you need to connect to a USB device, the fswebcam seems to be a more usable and stable app. The fswebcam allows for better collection and control of camera properties. Its best to use a config file to control exposure and resolution. Its usually better to leave the settings to auto, so the camera can work it out. It may be work better to make sure the camera skips the first 50 or so frames, so it can execute its auto focus, etc functions before taking a frame. To install the fswebcam package and set controls, do the following:

Photo Smearing

Sometimes you may see an artifact whereby a photographs "smears", as show below. If this problem persists, make sure you add the argument -rtsp_transport tcp to the ffmpeg command

Arguments

This plugin only needs 1 mandatory argument, a config filename, which as described above contains the Linux command to take a frame. All the other options are as follows

AXIS Camera Control

These are high quality cameras made in Sweden. They can be controlled (pan/zoom/tilt/etc) using a (local) web API. See reference: https://www.axis.com/support/developer-support/axis-camera-application-platform/q-and-a. API guide is found at : https://www.axis.com/files/tech_notes/script_guide.pdf. For controlling the camera, the userid must have access rights to undertake the task. Examples below

VIVOTEK Camera Control

These are cameras made in Taiwan. Some of them can be controlled (pan/zoom/tilt/etc) using a (local) web API. See reference: http://download.vivotek.com/downloadfile/downloads/usersmanuals/fd8167manual_en.pdf. For controlling the camera, the userid must have access rights to undertake the task. Examples below

Last updated

Was this helpful?