Motion - two webcams simultaneously

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Motion - two webcams simultaneously

Postby permitivity » Sun Jul 14, 2013 7:48 am

Hi,
So I have a Pogoplug with ArchLinuxArm. It runs Motion pretty well. Recently, I tried using two webcams on it, but I get this error below. In the Motion configuration, there is a "/dev/video0" and a "/dev/video1". Only video0 works, video1 doesn't. If I unplug video0 and restart Motion, video1 will work.

It seems to be a USB resource issue. I've tried it with different webcams, but using two webcams simultaneously seems to always run into this issue. A single webcam will always work. Is there a way around this?

I've tried lowering the rate of motion capture, but that doesn't fix it. It seems that in order to connect to a USB webcam, there's a certain amount of bandwidth that the devices requests...and I haven't been able to make it request less bandwidth.

$this->bbcode_second_pass_code('', '
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl (VIDIOCGCAP): Invalid argument
[2] Retrying until successful connection with camera
[2] cap.driver: "uvcvideo"
[2] cap.card: "Microsoft® LifeCam HD-3000"
[2] cap.bus_info: "usb-orion-ehci.0-1.3"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl (VIDIOCGCAP): Invalid argument
')
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am

Re: Motion - two webcams simultaneously

Postby xenoxaos » Mon Jul 15, 2013 8:06 pm

IF, your cameras support mjpeg....you might be able to request the mjpeg stream coming out of them. This uses less bandwidth, but still, two webcams on the same bus can be a problem.
Arch Linux ARM exists and continues to grow through community support, please donate today!
xenoxaos
Developer
 
Posts: 323
Joined: Thu Jan 06, 2011 1:45 am

Re: Motion - two webcams simultaneously

Postby permitivity » Fri Jul 19, 2013 12:30 am

Good idea. I couldn't figure out if the "Palette" option in motion performs this function...I'm not really sure what to call it.

For MJPEG, I picked the value of 2. However, I'm not sure if Motion is actually taking this setting seriously. Below this code block is the output of Motion. See the bold text which I think means it's not using MJPEG - it seems to be using #6, YUYV. But output also seems to indicate that the webcam I'm using (Microsoft HD3000) supports MJPEG, right?

$this->bbcode_second_pass_code('', '
# v4l2_palette allows to choose preferable palette to be use by motion
# to capture from those supported by your videodevice. (default: 8)
# E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and
# V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG.
# Setting v4l2_palette to 1 forces motion to use V4L2_PIX_FMT_SBGGR8
# instead.
#
# Values :
# V4L2_PIX_FMT_SN9C10X : 0 'S910'
# V4L2_PIX_FMT_SBGGR8 : 1 'BA81'
# V4L2_PIX_FMT_MJPEG : 2 'MJPEG'
# V4L2_PIX_FMT_JPEG : 3 'JPEG'
# V4L2_PIX_FMT_RGB24 : 4 'RGB3'
# V4L2_PIX_FMT_UYVY : 5 'UYVY'
# V4L2_PIX_FMT_YUYV : 6 'YUYV'
# V4L2_PIX_FMT_YUV422P : 7 '422P'
# V4L2_PIX_FMT_YUV420 : 8 'YU12'
v4l2_palette 2
')



$this->bbcode_second_pass_code('', '
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3489124 LIBAVFORMAT_BUILD 3481700
[0] Thread 1 is from /etc/motion/thread1.conf
[0] Thread 2 is from /etc/motion/thread2.conf
[1] Thread 1 started
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[2] Thread 2 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "Microsoft® LifeCam HD-3000"
[1] cap.bus_info: "usb-orion-ehci.0-1.1"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[b][1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)[/b]
[1] Selected palette YUYV
[1] Test palette YUYV (1280x720)
[1] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008
[1] found control 0x00980900, "Brightness", range 30,255
[1] "Brightness", default 133, current 133
[1] found control 0x00980901, "Contrast", range 0,10
[1] "Contrast", default 5, current 5
[1] found control 0x00980902, "Saturation", range 0,200
[1] "Saturation", default 83, current 83
[1] mmap information:
[1] frames=4
[1] 0 length=1843200
[1] 1 length=1843200
[1] 2 length=1843200
[1] 3 length=1843200
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[2] cap.driver: "uvcvideo"
[2] cap.card: "Microsoft® LifeCam HD-3000"
[2] cap.bus_info: "usb-orion-ehci.0-1.4"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Config palette index 8 (YU12) doesn't work.
[b][2] Supported palettes:
[2] 0: YUYV (YUV 4:2:2 (YUYV))
[2] 1: MJPG (MJPEG)
[2] Selected palette YUYV[/b]
[b][2] Test palette YUYV (1280x720)[/b]
[b][2] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008[/b]
[2] found control 0x00980900, "Brightness", range 30,255
[2] "Brightness", default 133, current 133
[2] found control 0x00980901, "Contrast", range 0,10
[2] "Contrast", default 5, current 5
[2] found control 0x00980902, "Saturation", range 0,200
[2] "Saturation", default 83, current 83
[2] mmap information:
[2] frames=4
[2] 0 length=1843200
[2] 1 length=1843200
[2] 2 length=1843200
[2] 3 length=1843200
[2] Error starting stream VIDIOC_STREAMON: No space left on device
[2] ioctl (VIDIOCGCAP): Invalid argument
[2] Could not fetch initial image from camera
[2] Motion continues using width and height from config file(s)
[2] Resizing pre_capture buffer to 1 items
')
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 3 guests