home *** CD-ROM | disk | FTP | other *** search
- <RC$title = Webcam Use>
- <RC$navurl = /samples/index.stm>
- <RC$navname = Samples>
- <RCinclude /header.stm>
-
- <BR>
- <FONT SIZE=5><B>Sambar Server WebCam</B></FONT>
- <P>
- The Sambar Server includes a WebCam module that can be used to take
- pictures. The source code for the WebCam module can be found in
- <I>samples/source/webcam.c</I>. This WebCam module uses Microsoft's
- <I>Video for Windows</I> to interact with the camera. Any camera that
- supports this standard should be compatible with the <I>webcam_snapshot</I>
- RPC.
- <P>
- To enable the webcam functionality, you must first
- install the WebCam module via the <I>config/config.ini</I> file.
- <P>
- <BLOCKQUOTE><CODE>
- INIT = samples.dll:webcam_init
- </CODE></BLOCKQUOTE>
- <P>
- Once initialized, the System Administrator can take a camera
- snapshot picture using the Sambar Server RPC:
- <P>
- <BLOCKQUOTE><CODE>
- <RCXwebcam_snapshot outfile=c:/sambar42/docs/picture.jpg>
- </CODE></BLOCKQUOTE>
- <P>
- The above RPC takes a picture and writes the output to the file specified
- in the <I>outfile</I> argument.
- <P>
- <H2>Automatic Pictures</H2>
- The server can be programmed to automatically take pictures by
- adding an entry in the <I>config/scheduler.ini</I> instructing the
- server to process a Sambar Script page with the <I>webcam_snapshot</I>
- RPC embedded in it. For example, the following entry will take a webcam
- snapshot every 5 minutes:
- <P>
- <BLOCKQUOTE><CODE>
- [cron]<BR>
- 5 * * * * = /session/url2file?fname=/docs/index.htm&url=/takepic.stm<BR>
- </CODE></BLOCKQUOTE>
- <P>
- The above cron entry results in the URL <I>takepic.stm</I> being executed
- every 5 minutes; the output of the URL request is written to the
- <I>index.htm</I> file in the docs directory. The following is a sample
- <I>takepic.stm</I> file:
- <P>
- <BLOCKQUOTE><CODE><PRE>
- <HTML>
- <BODY>
- <H1>Welcome to Brian-Cam</H1>
- <BR>
- <BR>
- <RCXwebcam_snapshot outfile=c:/sambar42/sysimage/brian.jpg>
- <IMG SRC=/sysimage/brian.jpg>
- <BR>
- Last update: <RCEdatetime>
- </BODY>
- </HTML>
- </PRE></CODE></BLOCKQUOTE>
- <BR>
-
- <RCinclude /footer.stm>
-