Re: udev rules for webcam

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 07, 2014 at 03:20:20PM -0500, Kevin Cummings wrote:
> On 11/06/2014 06:53 PM, Tom Horsley wrote:
> > On Thu, 6 Nov 2014 18:47:23 -0500
> > Fred Smith wrote:
> > 
> >> not finding anything on that, I hit on writing a udev rule for the
> >> USB device to make sure it appeared as a predictable /dev/video<x>.
> 
> Did you try looking in /dev/v4l?  My laptop builtin webcam leaves
> entries in there.  The v4l directory has 2 sub-directories: by-id and
> by-path which contain entries for my webcam.

Hi Kev!

Yes, late yesterday I learned enough about udev to find the files
there, so I've modified my script to use those files to figure out
which /dev entry is the webcam I'm interested in. I suppose I could
use those files directly, too, and save a bit of computation.

an excerpt from the script that operates the camera:

  # figure out which /dev/video<x> entry is the camera we want.
  foo=`ls -l --dereference-command-line-symlink-to-dir /dev/v4l/by-id/usb-046d_0825*`
  devnode=`echo $foo | sed -e "s;^.*> \.\./\.\./;;"`
  # then snap it
  ${progdir}/fswebcam --png 9 -d /dev/${devnode} -r 800x600 -F 2 --save ${day}/img-%Y%m%d-%H%M%S.png


-- 
---- Fred Smith -- fredex@xxxxxxxxxxxxxxxxxxxxxx -----------------------------
                    The Lord detests the way of the wicked 
                  but he loves those who pursue righteousness.
----------------------------- Proverbs 15:9 (niv) -----------------------------
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux