Turn on Webcam from Bash or Python
Hi everyone,
I have a problem about using webcam from terminal. I hope, you can help me. My notebook is MSI GE60 2PC Apache, and my OS is Debian 8 Jessie. When I press FN+F6, my webcam turns on and I can use webcam with cheese application. If I press FN+F6 again, webcam turns off and I can't use webcam, there is a message "No device found". I want to control webcam with python code or bash code, I don't want to press FN+F6. How can I do? Syslog has "udev", "evdev", "mtp-probe" .., I guess I will use these but which? Or I can use keypress function in python but how? That's my syslog output, when I press FN+F6: Code:
Apr 16 01:24:28 debian kernel: [34628.327642] usb 1-1.4: new high-speed USB device number 8 using ehci-pci |
You may try with ncurses:
Code:
|
Quote:
|
Code:
// spartan spartrekus |
Quote:
|
Quote:
|
Quote:
apt-get install ncurses-dev |
Mind you, it has nothing to do with enabling and disabling the camera-device.
|
you could try to emulate the keypresses with xdotool.
that is surely possible. with a little additional research, i'm sure there's ways to address the camera (driver) programmatically. |
Quote:
|
Xeratul's wasting your time.
All his C code does is run one of two commands: Code:
pkill mplayer ; mplayer -fs -zoom -tv device=/dev/video0 tv:// Code:
pkill mplayer ; mplayer -fs -zoom -tv device=/dev/video1 tv:// I think it's likely that what you're thinking of isn't possible. But here's someone who looked into it and didn't succeed: How to turn the laptop built-in webcam on/off from shell |
Quote:
Code:
xdotool key XF86AudioPause But, when I run Code:
xdotool key XF86WebCam Can I call Code:
state 0x10, keycode 220 (keysym 0x1008ff8f, XF86WebCam) |
xdotool is pretty good. are you sure that XF86WebCam is really seen?
you made a test with xev, I see. xbindkeys is pretty good!you can xbindkeys -k >> .xbindkeys and then edit it with leafpad eg., leafpad ~/.xbindkeys " xterm -e 'pkill mplayer ; mplayer -fs -zoom -tv device=/dev/video0 tv://' " m:0x10 + c:127 Mod2 + Pause |
Quote:
When I press "j" key: Code:
"(Scheme function)" Code:
"(Scheme function)" Code:
"(Scheme function)" |
Quote:
|
All times are GMT -5. The time now is 07:32 AM. |