I wrote script that in case of some event takes picture using usbUse the subprocess module to invoke the external program; see
webcam [Creative Live! Cam Vista IM (VF0420)] and command line utility
v4lctl (from package xawtv).
Problem1:
To catch error and info messages from script I used:
sys.stdout = open('/tmp/log','a')
sys.stderr=sys.stdout
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?
http://docs.python.org/library/subprocess.html specially the examples at
the end.
Problem2:Once you start using subprocess, you could write to some file what you get
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.
from the communicate() method - the error messages, if any, should be
there.
--
Gabriel Genellina