Author Topic: [SOLVED] Motion not working with USB camera  (Read 9995 times)

pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
[SOLVED] Motion not working with USB camera
« on: June 22, 2010, 09:06:42 pm »
Hia,
today i've installed my USB camera, as described in http://wiki.linuxmce.org/index.php/Analog_cameras
After that, the camera was recognized, but i get a static image. No change, after hours.
And if i do a reload router, no more connection, even with /etc/init.d/morion restart.

The motion wrapper config is:
Code: [Select]
#image settings
frequency 0
rotate 0
width 640
height 480
framerate 15
auto_brightness off
brightness 128
contrast 128
saturation 128
hue 128

#http control
control_localhost off
control_html_output on
control_port 8888

#filters
despeckle EedDl
lightswitch 50
minimum_motion_frames 2

#detection
noise_tune on
threshold_tune on
smart_mask_speed 5
gap 5
post_capture 30
pre_capture 15

#output
locate on
text_double off
webcam_quality 80
webcam_maxrate 5
text_changes on
text_right %m-%d-%Y\n%T

#movies
ffmpeg_cap_new on
ffmpeg_timelapse 60
ffmpeg_timelapse_mode daily
ffmpeg_video_codec mpeg4

#snapshot config
snapshot_interval 60
snapshot_filename %Y/%m/%d/%H/minute_%M_%S
jpeg_filename %Y/%m/%d/%H/minute_%M_%S
movie_filename %Y/%m/%d/recordings/%m_%d_%Y_%H_%M_%S
timelapse_filename %Y/%m/%d/timelapse/%m-%d-%Y-timelapse

The device is #2 (/dev/video2) as shown in my dmesg output:
Code: [Select]
dcerouter_1008240:/home/cameras/192/2010/06/22# dmesg | grep video
[    1.188831] pci 0000:03:00.0: Boot video device
[   18.288340] Linux video capture interface: v2.00
[   18.363566] ov511 2-1:1.0: USB OV511 video device found
[   19.249711] ivtv0: Registered device video0 for encoder MPG (4096 kB)
[   19.249797] ivtv0: Registered device video32 for encoder YUV (2048 kB)
[   19.249970] ivtv0: Registered device video24 for encoder PCM (320 kB)
[   19.337928] ivtv1: Registered device video1 for encoder MPG (4096 kB)
[   19.338028] ivtv1: Registered device video33 for encoder YUV (2048 kB)
[   19.338218] ivtv1: Registered device video25 for encoder PCM (320 kB)
[   19.939129] ov511 2-1:1.0: Device at usb-0000:00:04.0-1 registered to video2

Anyone got this?
Any hints?

TIA

Paulo
« Last Edit: June 23, 2010, 02:10:09 am by pw44 »

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: Motion not working with USB camera
« Reply #1 on: June 23, 2010, 12:34:23 am »
i had it working in an old install, but now it doesn't, not sure what changed.

Did the same thing you did. mine is video0 though.

Richard

pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #2 on: June 23, 2010, 02:15:38 am »
I also had it working before (some months ago), and i changed it by an IP Camera. Due the problems of loosing connection, i resolved to return the USB webcam and it did not work anymore. Solved by changing the following parameters in the configuration:

minimum_motion_frames 2

snapshot_interval 2

And had to REBOOT the core. /etc/init.d/motion restart did not help.

Have it working now.
« Last Edit: June 23, 2010, 02:17:54 am by pw44 »

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #3 on: June 23, 2010, 06:23:43 am »
That did it, thanks for sharing

I have an older one, that one is not working, but these newer ones are working, and that's great

Richard

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #4 on: June 23, 2010, 06:41:26 am »
Before i get too excited,

On my MD's i connected some usb camera's and they are not working.

Is there a different setting necessary, or maybe install the driver on the md?

Richard

pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #5 on: June 23, 2010, 12:32:16 pm »
I really don't know... Did not test. But considering that the core is to run 24x7 and the md' s only when desired, it would not make much sense having the security cameras (usb) connected to any of the md' s. I may be wrong, but that''s how i understand it.
There is an option for connecting other usb cameras and have it working: http://www.camsecure.co.uk/CamsecureUSBtoIP.html I will order one of this and see if it works.
« Last Edit: June 23, 2010, 05:54:03 pm by pw44 »

valent

  • Guru
  • ****
  • Posts: 381
    • View Profile
    • /kernel_reloaded/
Re: [SOLVED] Motion not working with USB camera
« Reply #6 on: June 24, 2010, 01:09:12 pm »
Could you please add these information to wiki, you have found quite a lot of great solutions to some of most annoying LinuxMCE bugs. I'm really grateful for your work.

If you have unsupported webcam you can try to do a kernel update:
http://wiki.linuxmce.org/index.php/Upgrading_the_Kernel#Installing_newer_2.6.3x_kernels_for_0810_via_PPA_repository
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #7 on: June 24, 2010, 10:49:35 pm »
my md's are on 24/7 so don't see why this would be a problem.

I'm looking at what it is, but it seems that the drivers are not loaded on the md.

Richard

pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #8 on: June 25, 2010, 01:03:59 pm »
Richard,
take a look at: http://www.aboutdebian.com/webcam.htm
apt-get install webcam-server
There are maybe others..... but this may solve your needs / wishes.
Paulo
« Last Edit: June 25, 2010, 01:12:43 pm by pw44 »

pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #9 on: June 26, 2010, 08:12:05 pm »
V4l2 seems to have bugs..... my ov511 webcam, which used to work great, is now having problems, after the v4l2 drivers update.
The usb system becomes unstable when the ov511 is loaded. gyro mouse and gyration remote hangs short after the system is ready, router reloads from itself, unplugging and plugging back the webcam does not work....
Starting the system without the webcam (unplugged) works and no problem with other usb peripherals.

pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
Re: [SOLVED] Motion not working with USB camera
« Reply #10 on: June 27, 2010, 11:05:29 pm »
Could you please add these information to wiki, you have found quite a lot of great solutions to some of most annoying LinuxMCE bugs. I'm really grateful for your work.
Done. wiki updated

Quote
If you have unsupported webcam you can try to do a kernel update:
http://wiki.linuxmce.org/index.php/Upgrading_the_Kernel#Installing_newer_2.6.3x_kernels_for_0810_via_PPA_repository
There are problems in the newest v4l2-modules drivers. I did try 3 different usb webcams and all are making the usb system unstable (mouse freezes, repplug is not recognized). It worked before this newest  modules.
« Last Edit: June 28, 2010, 06:57:51 pm by pw44 »