home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Komunik / sambar / sambar51p.exe / docs / samples / webcam.stm < prev   
Encoding:
Text File  |  2002-01-13  |  2.1 KB  |  66 lines

  1. <RC$title = Webcam Use>
  2. <RC$navurl = /samples/index.stm>
  3. <RC$navname = Samples>
  4. <RCinclude /header.stm>
  5.  
  6. <BR>
  7. <FONT SIZE=5><B>Sambar Server WebCam</B></FONT>
  8. <P>
  9. The Sambar Server includes a WebCam module that can be used to take
  10. pictures.   The source code for the WebCam module can be found in
  11. <I>samples/source/webcam.c</I>.  This WebCam module uses Microsoft's
  12. <I>Video for Windows</I> to interact with the camera.  Any camera that
  13. supports this standard should be compatible with the <I>webcam_snapshot</I>
  14. RPC.
  15. <P>
  16. To enable the webcam functionality, you must first
  17. install the WebCam module via the <I>config/config.ini</I> file.
  18. <P>
  19. <BLOCKQUOTE><CODE>
  20. INIT = samples.dll:webcam_init
  21. </CODE></BLOCKQUOTE>
  22. <P>
  23. Once initialized, the System Administrator can take a camera
  24. snapshot picture using the Sambar Server RPC:
  25. <P>
  26. <BLOCKQUOTE><CODE>
  27. <RCXwebcam_snapshot outfile=c:/sambar42/docs/picture.jpg>
  28. </CODE></BLOCKQUOTE>
  29. <P>
  30. The above RPC takes a picture and writes the output to the file specified
  31. in the <I>outfile</I> argument.  
  32. <P>
  33. <H2>Automatic Pictures</H2>
  34. The server can be programmed to automatically take pictures by 
  35. adding an entry in the <I>config/scheduler.ini</I> instructing the
  36. server to process a Sambar Script page with the <I>webcam_snapshot</I>
  37. RPC embedded in it.  For example, the following entry will take a webcam
  38. snapshot every 5 minutes:
  39. <P>
  40. <BLOCKQUOTE><CODE>
  41. [cron]<BR>
  42. 5 * * * * = /session/url2file?fname=/docs/index.htm&url=/takepic.stm<BR>
  43. </CODE></BLOCKQUOTE>
  44. <P>
  45. The above cron entry results in the URL <I>takepic.stm</I> being executed
  46. every 5 minutes; the output of the URL request is written to the 
  47. <I>index.htm</I> file in the docs directory.   The following is a sample
  48. <I>takepic.stm</I> file:
  49. <P>
  50. <BLOCKQUOTE><CODE><PRE>
  51. <HTML>
  52. <BODY>
  53. <H1>Welcome to Brian-Cam</H1>
  54. <BR>
  55. <BR>
  56. <RCXwebcam_snapshot outfile=c:/sambar42/sysimage/brian.jpg>
  57. <IMG SRC=/sysimage/brian.jpg>
  58. <BR>
  59. Last update: <RCEdatetime>
  60. </BODY>
  61. </HTML>
  62. </PRE></CODE></BLOCKQUOTE>
  63. <BR>
  64.  
  65. <RCinclude /footer.stm>
  66.