Friday, January 18, 2013

Raspberry Pi and USB Web Camera + Motion



I Have old usb web camera and i try to plug at my raspberry usb port, to know webcam detected and recongnized by linux then give a command :

dmesg

[   99.186841] usb 1-1.3: Product: USB Camera
[   99.186857] usb 1-1.3: Manufacturer: OmniVision Technologies, Inc.
[   99.602403] input: ov519 as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/input/input0
[   99.611564] usbcore: registered new interface driver ov519
[   99.762003] usbcore: registered new interface driver snd-usb-audio


or

lsusb

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10/100 Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05a9:4519 OmniVision Technologies, Inc. Webcam Classic



you will find that devices detected or not, my old webcam work with raspberry pi ....:)), its nice

then i try to stream to network with motion

pacman -S motion

check usb web cam frame size and pixel format  using

v4l2-ctl --list-formats-ext

 ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'JPEG' (compressed)
        Name        : JPEG
                Size: Discrete 320x240
                Size: Discrete 640x480



then edit motion configuration file

nano /etc/motion/motion.conf

set :


# 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 3 # use pixel format according result from test above 
webcam_localhost off # to acess from outside

Start Motion

motion -n

acess from our PC with adress  http://[ipadressofdevices]:8081 using firefox, acess using internet explorer not working




4 comments:

  1. I have the same webcam and the video driver keeps failing. Did you have to do anything special or did it just work?

    [1] Using V4L2
    Unsupported marker type 0xf5
    [1] Video device fatal error - Closing video device
    [1] Closing video device /dev/video0

    uname -a
    Linux picapture 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux

    ReplyDelete
    Replies
    1. I have the same problem
      you found a solution?

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. WE ARE HIRING NEW HOT CAM MODELS!
    RECEIVE OVER $10,000 PER WEEK.
    REGISTER AS A BONGA MODELS WEBCAM MODEL TODAY!

    ReplyDelete