USB WebCam and MJPEG instead of YUYV

Forum for questions and support relating to the 1.25.x releases only.
Locked
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

USB WebCam and MJPEG instead of YUYV

Post by ris2t »

Is it possible to configure zoneminder 1.25.0-1 (Ubuntu 12.04 version) to utilise MJPEG from locally attached USB camera's rather than YUYV palette.

Currently I'm hitting USB memory and resolution limits when attempting 3 web cams and one extended via an USB RJ45 extension adapter.

Using luvcview or guvcview I can have all 3 streaming utilsing MJPEG but under zoneminder and YUYV palette 1 of the 3 camera's fails.

Also hitting issues with the USB extension dropping out the YUYV capabilities or reducing its quality significantly but not impacting MJPEG format as much.

------------
http://sourceforge.net/projects/mjpg-streamer/ - I'm aware of MJPEG-Streamer but hoping for native configuration within zoneminder.

http://www.zoneminder.com/forums/viewto ... =USB+MJPEG - this patch looks to have promise. Can any one confirm?

------------

output of lsusb for the 3 cameras

Code: Select all

Bus 002 Device 004: ID 046d:080a Logitech, Inc. Portable Webcam C905
Bus 002 Device 005: ID 04f2:a138 Chicony Electronics Co., Ltd 
Bus 007 Device 002: ID 046d:0994 Logitech, Inc. QuickCam Orbit/Sphere AF
Example error (from non RJ45 extended webcam). I've confirmed its ok when I unplug one of the other USB web cams so its definitely the USB memory limits. I'll attempt to juggle controllers to balance but its only one part of the puzzle/problems.

Code: Select all

zmc_dvideo_ds[21733]: FAT [Failed to start capture stream: No space left on device]
May  5 22:00:53 hammerstien kernel: [15120.609375] uvcvideo: Failed to submit URB 0 (-28).
Example below of the capabilities that drop via the extension hinting that MJPG is a better choice over YUYV.

uvcdynctrl -f -d /dev/video2 - via the RJ45 extension

Code: Select all

Listing available frame formats for device /dev/video2:
Pixel format: MJPG (MJPEG; MIME type: image/jpeg)
  Frame size: 160x120
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 176x144
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 320x240
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 352x288
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 640x480
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 800x600
    Frame rates: 15, 10, 5
Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)
  Frame size: 160x120
    Frame rates: 15, 10, 5
  Frame size: 176x144
    Frame rates: 15, 10, 5
uvcdynctrl -f -d /dev/video2 without

Code: Select all

uvcdynctrl -f -d /dev/video2
Listing available frame formats for device /dev/video2:
Pixel format: MJPG (MJPEG; MIME type: image/jpeg)
  Frame size: 160x120
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 176x144
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 320x240
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 352x288
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 640x480
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 800x600
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 960x720
    Frame rates: 15, 10, 5
Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)
  Frame size: 160x120
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 176x144
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 320x240
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 352x288
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 640x480
    Frame rates: 30, 25, 20, 15, 10, 5
  Frame size: 800x600
    Frame rates: 25, 20, 15, 10, 5
  Frame size: 960x720
    Frame rates: 10, 5
  Frame size: 1600x1200
    Frame rates: 5
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Re: USB WebCam and MJPEG instead of YUYV

Post by ris2t »

I can confirm mastertheknife's patches for 1.50.0 work for my questions. MJPEG instead of YUYV from the USB webcams. Must better quality over the RJ45 extension. Still got no space left on device errors with 3 cams but rejigging the controllers they're plugged into should address that.

Install took a few attempts. Here are some of my notes.

Tried to map to the default ubuntu paths, although /usr/local is more correct I wanted consistency with what I know.

Code: Select all

./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datarootdir=/usr/share --sysconfdir=/etc/zm  --with-libarch=lib64 --with-webdir=/usr/share/zoneminder/ --with-cgidir=/usr/share/zoneminder/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-mmap=yes
perl module still installed in /usr/local/share/perl/5.14.2, couldn't find a switch for them.

/etc/zm/apache.conf - had to manually add ScriptAlias to get around the follow errors and live camera not streaming over web.

Code: Select all

May  6 20:49:35 xxxx web_php[9075]: ERR [socket_sendto( /tmp/zm/zms-989640s.sock ) failed: No such file or directory]
apache.conf

Code: Select all

Alias /zm /usr/share/zoneminder
ScriptAlias /cgi-bin /usr/share/zoneminder/cgi-bin

<Directory /usr/share/zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>
Locked