User Guide

Appendix A – Included Application
Axis Communications AB does not provide support for application development of any kind. The
information here is provided "as is", and there is no guarantee that any of the examples shown
will work in your particular application.
Revision 0.91 June 2001 24
5.3.2 Examples
This example shows how to take one(1) image with camera one(1). The resulting
image will be of size 640x480 and with other attributes set according to what the
camera is set to. The image will be stored in /tmp/SNAP/ and named snapshot.
bufferd -start -buffername SNAP -snapshot -pre
1 -format snapshot -uri ftp://axis-
cgi/jpg/1/fullsize.jpg
The following example can be used in a PHP3-script, and is equivalent to the example
above.
function shoot() {
$command = "bufferd -start -buffername SNAP";
$command .= " -snapshot -pre 1";
$command .= " -format snapshot";
$command .= " -uri ftp://axis-
cgi/jpg/1/fullsize.jpg";
system($command);
}
The following example creates a buffer that saves its images to the directory
/tmp/ALARM/, where the files are named after the creation-time. The captured
images will be half-sized (320x240) and captured every two(2) seconds by the first
camera. Five(5) images before and two(2) images after the buffer is stopped, are
saved.
bufferd -start -buffername ALARM -uri
ftp://axis-cgi/jpg/1/halfsize.jpg -pre 5 -post
2 -postdelay 2000
This example shows how to stop the buffer started above.
bufferd -stop -buffername ALARM
This example resets (i.e. stops buffering and clears the directory) the buffer specified
in the last example.
bufferd -reset -buffername ALARM
Let's say a method of buffering images is required, and when an arbitrary event
occurs, read alarm; the images taken will be handled and the buffering should
thereafter continue. The following example illustrates the steps to take (using the
examples above):