Python script + v4lctl

Gatis gatisl at inbox.lv
Mon Oct 20 04:15:34 EDT 2008


Hello!
Intro: 
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).
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?
Problem2:
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
[https://help.ubuntu.com/community/EasyCam].
Where can be found v4lctl return codes?
Best regards,
Gatis Liepins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081020/47af7390/attachment.html>


More information about the Python-list mailing list