Uvc

From ZoneMinder Wiki
Jump to navigationJump to search

Introduction

This page describes how to get a camera that uses the new UVC V4L2 drivers to work in ZoneMinder. This document does not describe in detail how to install the required software, just what is required. Please consult your linux distrobution's package install documentation.

Unconfirmed code for V4L2 support in Zoneminder can be found in this ZM Forum Discussion that took place during the spring of 2008.

NOTE: As of July 21 2008 support for V4L2 drivers has been incorporated into Zoneminder 1.24.0 [1], rendering this method not required for most uvcvideo enabled cams.

Cameras found to work using this method

Below is a list of cameras found to work using this method. If you get a camera working with this method, please add the camera details here.

  1. Logitech Orbit Sphere (new version) USB device ID: 046d:08c2
  2. Logitech Quickcam Pro 5000 USB device ID: 046d:08c5
  3. Logitech USB Silver QuickCam Ultra Vision device ID: 046d:08c9
  4. Logitech Quickcam Pro 9000 USB device ID: 046d:0990 but check the part number reference here http://www.quickcamteam.net/hcl/linux/logitech-webcams before buying. To identify the part number you need to examine the paper tag on the connector end of the USB cable.
  5. Dynex DX-WEB1C
  6. RocketFish RF-WEB2C
  7. Microsoft Lifecam VX 5000 (may need further optimization, but initial tests were successful.)

Note: Currently the only supported resolution is: 320x240. mjpg_streamer defaults to 640x480, so make sure to declare the necessary resolution when running the program (see below.)

Required Software

  1. Linux UVC drivers http://linux-uvc.berlios.de/
  2. UVC_streamer http://www.naaa.de/uvc_streamer.htm
  3. Web Browser that allows you to view streams (Firefox works well) http://www.firefox.com/
  4. Working install of ZoneMinder

Procedure

Kernel Drivers

Download and install the UVC kernel drivers

UVC Streamer

  1. Download and install the UVC Streamer software
    1. utar/gz the downloaded archive and type 'make' this will compile an executable called 'mjpg_streamer' (version 2) or uvc_stream (version 1)
    2. no 'make install' is needed (or available in the makefile).
  2. Just run the compiled mjpg_streamer (or uvc_stream) from the current dir
    1. this will gather and run the webcam with its defaults
    2. run 'mjpg_streamer --help' (or uvc_stream) for help
  • If your ZM setup does not have enough buffer memory... you might need to start the streamer software with the following options '-f 1 -r 320x240 -b'
    • This sets the 320x240 resolution at 6 fps, or else ZoneMinder might not get the stream.
mjpg_streamer -i "input_uvc.so -r 320x240 -f 6" -o "output_http.so -p 8080"  -b

or for the original release version 1

uvc_stream -f 1 -r 320x240 -b

Check if the stream works. Use firefox and point it to the ip address and port of the machine that runs the streamer (default for UVC_streamer is 8080). If you use firefox on the same machine where the streamer runs, you can use localhost.

http://localhost:8080

If the above url doesn't work, try http://localhost:8080/?action=snapshot to capture stills or http://localhost:8080/?action=stream to view the stream.

If your setup is working, then you will see a stream of the camera.

There is some evidence that Firefox 3 sometimes has problems displaying streams and will show a single frame instead. If this happens, just for the purposes of testing your webcam with mjpg_streamer, temporarily use VLC instead. In VLC: click File > Open Network Stream... Select HTTP option and paste http://localhost:8080/?action=stream or your equivalent.

ZoneMinder

  1. Browse to the ZoneMinder control panel.
  2. Define a new Monitor, and use the following settings:

Under 'General' tab:

Source type: remote

Under 'Source' tab:

Remote host Name: <ip of host with camera> or if on same host than zoneminder use localhost

Remote host port: 8080 (or if you used another port with uvc_stream put it in here)

Remote Host path: For version 1.x (uvc_stream) : "snapshot" (the current version of uvc_stream constantly reloads any other request)

OR

Remote Host path: For version 2.x (mjpg_streamer) : /?action=snapshot or /?action=stream

There have been comments that Zoneminder v1.22.3 seems to not like action=stream, but I found it works OK. The only problem I had displaying a stream was when trying to view it in Firefox 3 with http://localhost:8080/?action=stream

Capture witdth: 320

Capture height: 240


Save, and your UVC camera is ready to use.