Version 0 of A Webcam setup with tcl scripts

Updated 2008-03-09 16:16:02 by theover

by Theo Verelst

Running a Web Server ( www.theover.org ) with Fedora 8/64 on a fairly fast machine I made some Tcl scripts as cgi´s.

On this page I record how I put up a webcam based on a good quality video cam (an old digital Sony above average consumer model with seperate microphone) and a digitizer box (pinnacle 6mbit/S mpeg-2 TVDeLuxe USB, years old) which I interface on Linux with Dune.

The webcam is based on a Tcl script which is a cgi, placed in the cgi directory with the code on top to load the tcl interpreter from sh. That main script runs as apache user, and connects to a transfer script to get access to the main digitizer script (all three tcl) which starts dune on request, and must (as it is) run as root.

The latter is started from ´´´/etc/rc´´´ by adding:

   tclsh  /path/servcam.tcl > /path/mess 2>&1 &

Where ´´´servcam.tcl´´´ is:

 set ss [socket -server servvid 1234]

 proc servvid {s i p} {
   global argv
   puts "connection from $i"
   flush stdout
   fconfigure $s -translation binary
    set f [ open "| /usr/local/bin/dunerec -t dvd -i 1 -R - 2> /path/messdune" r]
   fconfigure $f -translation binary
   fileevent $s readable "puts \"read: \[gets $s\]\" ; flush stdout
      if \[eof $s\] {
      close $s
      close $f
      puts {End of file.}} "
   after 2000
   fileevent $s writable "fcopy $f $s -size 1024
      if \[eof $s\] {
      close $s
      close $f
      puts {End of file.}} "
 }

 vwait forever

Which is an adapted script I use for local network TV distribution.

The in-between script is ´´´socktostdout3b.tcl´´´


enter categories here