The camera daemon camerad
is started automatically at boot-time and provides remote frame grabbing and web server functionality. The AJAX LiveView uses the camerads
' web service to setup the image sensor and to grab images.
camerad
itself and the configuration files are stored in the flash file system in directory /ffx/www/camerad
, the automatically startup is done in /ffx/rcS
.
In file devices.xml
are declared which services are enabled. In the example below the service ORemoteCamera and the web server are configured. The web server binds to port 8080 at startup and uses /ffx/www/wwwroot
as its document root. The Webserver is also able to run external CGI handlers (e.g. php).
<?xml version="1.0" ?> <Config> <Devices> <ORemoteCamera /> </Devices> <Webserver> <ExtToMime> <Map key="htm" value="text/html" /> <Map key="css" value="text/css" /> <Map key="js" value="text/javascript" /> <Map key="html" value="text/html" /> <Map key="gif" value="image/gif" /> <Map key="jpg" value="image/jpeg" /> <Map key="jpeg" value="image/jpeg" /> <Map key="bmp" value="image/bmp" /> <Map key="png" value="image/png" /> </ExtToMime> <IndexNames> <Item value="index.htm" /> <Item value="index.html" /> <Item value="index.php" /> </IndexNames> <DocumentRoot value="/ffx/www/wwwroot" /> <Port value="8080" /> <NumThreads value="3" /> <CgiHandler exec="/ffx/bin/php" timeout="30000"> <Extension value="php" /> </CgiHandler> <CgiHandler exec="self" timeout="30000"> <Extension value="cgi" /> </CgiHandler> </Webserver> </Config>
The settings.xml
stores default settings for image acquisition. If the camerad gets the URL request /webcam/liveimage.jpg
from a client (e.g. internet browser) the daemon sets up the image interface with the settings below and send the image to the client. With the URL /webcam/imagecontrol.ait
the client is able to control the image acquisition parameters. To learn more about this see the example live.html
stored in camerads
directory.
<?xml version="1.0" ?> <Config> <LiveSettings> <CameraTimeout value="5000" /> <ImageHtml value="/webcam/liveimage.html" /> <ImageUrl value="/webcam/liveimage.jpg" /> <ImageControl value="/webcam/imagecontrol.ait" /> <ImageSettings> <Type value="JPEG" /> <Width value="640" /> <Height value="480" /> <Quality value="2" /> </ImageSettings> <Median value="0" /> <Gain value="3" /> <Framerate value="20" /> <ShutterTime value="8000" /> <SensorFrequency value="40" /> <TriggerSrc value="1" /> <TriggerDelay value="0" /> <TriggerTimeout value="5" /> <SBOIIllumination value="1" /> <ExtIllumination value="0" /> <IlluminationDelay value="0" /> <IlluminationDuration value="2000" /> <ErrorImage value="errorimage.png" /> </LiveSettings> </Config>
With ORemoteCamera you are able to remote grab images and to change image acquisition parameters on the camera device using the Microsoft Windows platform. After the installation of the latest ORemoteCamera libraries you can test your setup with the example source code available in your ORemoteCamera location.