Linux Webcam Detection

1,701 views
Skip to first unread message

Zach 'Hoeken' Smith

unread,
Jun 30, 2013, 9:29:42 AM6/30/13
to botq...@googlegroups.com
Botqueue v0.4 is almost ready and the one thing holding me back is figuring out the right way to scan for webcams on linux/raspberry pi.  One option is just to do a ls /dev/video* and call it a day.

I'd rather be complete though and do it 'properly' but I can't figure out the right way to do that and fswebcam doesn't seem to have a list cameras option.

Any ideas?

----

Zach Hoeken Smith

Twitter: @hoeken  Skype: chilldude22
QQ: 1489598623  China: +86-186-8209-7069

Zach 'Hoeken' Smith

unread,
Jun 30, 2013, 9:43:40 PM6/30/13
to botq...@googlegroups.com
Okay, I dug into it a little bit more and I have 2 options.  Can you folks on linux and/or raspberry pi run these commands and send me the output?  I've tested it on my end with a bunch of cameras and crap, but I want to make sure I don't miss anything strange out there.

#install the programs
sudo apt-get install uvcdynctrl v4l-utils

#run these and send me your output
uvcdynctrl --list
v4l2-ctl --all
v4l2-ctl --info



----

Zach Hoeken Smith

Twitter: @hoeken  Skype: chilldude22
QQ: 1489598623  China: +86-186-8209-7069


Justin Nesselrotte

unread,
Jun 30, 2013, 9:50:44 PM6/30/13
to botq...@googlegroups.com
This is without any webcam. I'll post tomorrow with a webcam when I have one:
uvcdynctrl --list
Listing available devices:
No devices found.

v4l2-ctl --all
Failed to open /dev/video0: No such file or directory

v4l2-ctl --info
Failed to open /dev/video0: No such file or directory

Sorry about the lack of USB camera. Any idea on the Mac? I can work on that side if you need me to.

Zach 'Hoeken' Smith

unread,
Jun 30, 2013, 10:05:15 PM6/30/13
to botq...@googlegroups.com
Oh, mac is easy and done already.  :)


----

Zach Hoeken Smith

Twitter: @hoeken  Skype: chilldude22
QQ: 1489598623  China: +86-186-8209-7069


--
You received this message because you are subscribed to the Google Groups "BotQueue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botqueue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

graphmastur

unread,
Jun 30, 2013, 10:06:42 PM6/30/13
to botq...@googlegroups.com

Really? Awesome work! How do you do it on Mac? Does it have to be a Mac webcam, or does an external usb one work?

Zach 'Hoeken' Smith

unread,
Jun 30, 2013, 10:30:53 PM6/30/13
to botq...@googlegroups.com
Both.  the imagesnap program has a list cameras option.  :)


----

Zach Hoeken Smith

Twitter: @hoeken  Skype: chilldude22
QQ: 1489598623  China: +86-186-8209-7069


Philip Booysen

unread,
Jul 1, 2013, 10:41:29 AM7/1/13
to botq...@googlegroups.com
Apologies, away from my Bot for another 12 days. Will only submit then if it still makes sense.

P

Justin Nesselrotte

unread,
Jul 1, 2013, 10:59:24 AM7/1/13
to botq...@googlegroups.com
With a camera:

uvcdynctrl --list
Listing available devices:
  video0   Microsoft LifeCam VX-5000
    Media controller device: /dev/media0
ERROR: Unable to open media controller device '/dev/media0': Permission denied (Error: 13)
ERROR: Unable to list device entities: Invalid device or device cannot be opened. (Code: 5)

v4l2-ctl --all
Driver Info (not using libv4l2):
Driver name   : uvcvideo
Card type     : Microsoft LifeCam VX-5000
Bus info      : usb-bcm2708_usb-1.2
Driver version: 3.6.11
Capabilities  : 0x04000001
Video Capture
Streaming
Format Video Capture:
Width/Height  : 640/480
Pixel Format  : 'YUYV'
Field         : None
Bytes per Line: 1280
Size Image    : 614400
Colorspace    : Unknown (00000000)
Crop Capability Video Capture:
Bounds      : Left 0, Top 0, Width 640, Height 480
Default     : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Video input : 0 (Camera 1: ok)
Streaming Parameters Video Capture:
Capabilities     : timeperframe
Frames per second: 30.000 (30/1)
Read buffers     : 0

v4l2-ctl --info
Driver Info (not using libv4l2):
Driver name   : uvcvideo
Card type     : Microsoft LifeCam VX-5000
Bus info      : usb-bcm2708_usb-1.2
Driver version: 3.6.11
Capabilities  : 0x04000001
Video Capture
Streaming

I'll try to get another camera to test later.


On Sunday, June 30, 2013 8:29:42 AM UTC-5, Zach Smith wrote:

Zach 'Hoeken' Smith

unread,
Jul 1, 2013, 11:00:40 AM7/1/13
to botq...@googlegroups.com
actually it appears that uvcdynctrl -l -v is more useful.  could you get me the output from that too?


----

Zach Hoeken Smith

Twitter: @hoeken  Skype: chilldude22
QQ: 1489598623  China: +86-186-8209-7069


--

Justin Nesselrotte

unread,
Jul 1, 2013, 11:23:41 AM7/1/13
to botq...@googlegroups.com
Yeah, of course:

uvcdynctrl -l -v
Listing available devices:
  video0   Microsoft LifeCam VX-5000 [uvcvideo, usb-bcm2708_usb-1.2]
    Media controller device: /dev/media0
ERROR: Unable to open media controller device '/dev/media0': Permission denied (Error: 13)
ERROR: Unable to list device entities: Invalid device or device cannot be opened. (Code: 5)

Although that didn't tell you much else. I shall invoke the power of root:
sudo uvcdynctrl -l -v
Listing available devices:
  video0   Microsoft LifeCam VX-5000 [uvcvideo, usb-bcm2708_usb-1.2]
    Media controller device: /dev/media0
    Entity 1: Microsoft LifeCam VX-5000. Type: 65537, Revision: 0, Flags: 0, Group-id: 0, Pads: 1, Links: 0
      Device node
      Entity: 1, Pad 0, Flags: 1
    Entity 2: Processing 2. Type: 131072, Revision: 0, Flags: 0, Group-id: 0, Pads: 2, Links: 1
      Subdevice:       Entity: 2, Pad 0, Flags: 1
      Entity: 2, Pad 1, Flags: 2
      Out link: Source pad { Entity: 2, Index: 1, Flags: 2 } => Sink pad { Entity: 1, Index: 0, Flags: 1 }
    Entity 3: Camera 1. Type: 131072, Revision: 0, Flags: 0, Group-id: 0, Pads: 1, Links: 2
      Subdevice:       Entity: 3, Pad 0, Flags: 2
      Out link: Source pad { Entity: 3, Index: 0, Flags: 2 } => Sink pad { Entity: 2, Index: 0, Flags: 1 }
      Out link: Source pad { Entity: 3, Index: 0, Flags: 2 } => Sink pad { Entity: 4, Index: 0, Flags: 1 }
    Entity 4: Extension 4. Type: 131072, Revision: 0, Flags: 0, Group-id: 0, Pads: 2, Links: 0
      Subdevice:       Entity: 4, Pad 0, Flags: 1
      Entity: 4, Pad 1, Flags: 2

Justin Nesselrotte

unread,
Jul 1, 2013, 11:34:34 AM7/1/13
to botq...@googlegroups.com
I tried running it with this camera, and I got:

[2013-07-01 10:26:28,386] ERROR: dummy: Webcam: Error opening device: /dev/media0
[2013-07-01 10:26:28,390] ERROR: dummy: Webcam: open: Permission denied
[2013-07-01 10:26:28,393] ERROR: dummy: Webcam: Error opening device: /dev/media0
[2013-07-01 10:26:28,396] ERROR: dummy: Webcam: open: Permission denied
[2013-07-01 10:26:28,399] ERROR: dummy: Webcam: Unable to find a source module that can read /dev/media0.
[2013-07-01 10:26:28,403] ERROR: dummy: Webcam: 


Running with sudo, I got (Don't run with sudo, it messes up the files for anyone else reading this):

[2013-07-01 10:33:20,747] ERROR: dummy: Webcam: /dev/media0: Not a V4L2 device?
[2013-07-01 10:33:20,750] ERROR: dummy: Webcam: /dev/media0: Not a V4L device?
[2013-07-01 10:33:20,763] ERROR: dummy: Webcam: VIDIOCGCAP: Inappropriate ioctl for device
[2013-07-01 10:33:20,767] ERROR: dummy: Webcam: Unable to find a source module that can read /dev/media0.
[2013-07-01 10:33:20,770] ERROR: dummy: Webcam: 

Zach 'Hoeken' Smith

unread,
Jul 1, 2013, 9:11:29 PM7/1/13
to botq...@googlegroups.com
That'll work. I can parse that no problem. 
--

Nick Foley

unread,
Jul 22, 2013, 3:59:37 PM7/22/13
to botq...@googlegroups.com
Seem to be getting this same set of errors with a Microsoft Lifecam HD-6000
To unsubscribe from this group and stop receiving emails from it, send an email to botqueue+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

matthew bennett

unread,
Aug 2, 2013, 5:04:26 PM8/2/13
to botq...@googlegroups.com
I'm just digging into Botqueue, and I'm liking it!  Thanks, Zach!

I'm trying to use a Logitech C270 and botqueue 0.4, and it's not quite working. I think it's on /dev/video0 . Here's my output:

~$ uvcdynctrl -l -v
[libwebcam] Unsupported V4L2_CID_EXPOSURE_AUTO control with a non-contiguous
  range of choice IDs found
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A0901, name = 'Exposure, Auto'
Listing available devices:
  video0   UVC Camera (046d:0825) [uvcvideo, usb-0000:00:1d.0-2]

 v4l2-ctl --all
Driver Info (not using libv4l2):
    Driver name   : uvcvideo
    Card type     : UVC Camera (046d:0825)
    Bus info      : usb-0000:00:1d.0-2
    Driver version: 3.2.14

    Capabilities  : 0x04000001
        Video Capture
        Streaming
Format Video Capture:
    Width/Height  : 640/480
    Pixel Format  : 'MJPG'
    Field         : None
    Bytes per Line: 0
    Size Image    : 31466
    Colorspace    : SRGB

Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 640, Height 480
    Default     : Left 0, Top 0, Width 640, Height 480
    Pixel Aspect: 1/1
Video input : 0 (Camera 1: ok)
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 30.000 (30/1)
    Read buffers     : 0



Reply all
Reply to author
Forward
0 new messages