Notes on the camera server
Adjusting the v4l frame buffer
Before you do anything you have to run the following as root (sudo will not do).
#!/bin/sh v4l-conf -c /dev/video0 -a 0xd8000000 v4l-conf -c /dev/video1 -a 0xd8000000 v4l-conf -c /dev/video2 -a 0xd8000000 v4l-conf -c /dev/video3 -a 0xd8000000
There is a script /usr/bin/fix-v4l which will do this.
Using mplayer to look at a camera
mplayer -tv device=/dev/video0:driver=v4l:width=640:height=480:outfmt=i420:norm=ntsc \ -vc rawi420 -vo xv tv://
Replace /dev/video0 with /dev/video1..3 for cameras 2..4.
Existing Monitor Solution
/usr/local/bin/videorecord.pl is run at startup. It works like this:
- Use mplayer to grab 10 frames from the camera (need 10 to get capture going reliably)
- Move the 10th frame to /var/www/localhost/htdocs/current.jpg
- Erase the other 9 frames
- Fork and ftp current.jpg to ftp.jplt.com in the background
- Record 60 seconds of m4v video to /var/www/localhost/htdocs/video/YYYY-MM-DD_hhhmmm.m4v
- Rinse and repeat
It runs as justin. I've hacked up some scripts to get it to init properly in the background, even though it's a perl script.