Python script + v4lctl
gatisl at inbox.lv
Mon Oct 20 10:15:34 CEST 2008
I wrote script that in case of some event takes picture using usb
webcam [Creative Live! Cam Vista IM (VF0420)] and command line utility
v4lctl (from package xawtv).
To catch error and info messages from script I used:
sys.stdout = open('/tmp/log','a')
All writes to log file well, except v4lctl error messages. If script
is run from commandline, than v4lctl error messages are shown there.
How to catch these messages?
When script is run from /etc/init.d (in runlevel 2) during boot, no
pictures are taken. I can't tell error message, because of Problem1.
If I execute now v4lctl from commandline (while my script is running
in background), picture is taken.
If script is restarted (using same init.d startup script that was
used by pc to start my python script) pictures are taken - all works.
I set in rc2.d that script starts at the end of boot - "S99script" -
so it starts after webcam drivers are loaded.
I set delay of minute at the begining of script to allow pc to finish
boot - no results.
In dmesg there are error messages:
"v4lctl: segm: ...... : error 4"
Command executed: v4lctl -c /dev/video0 snap jpeg full test.jpg
Using Linux Ubuntu 8.
Drivers for webcam - using EasyCam
Where can be found v4lctl return codes?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list