Error: failed to query crop capabilities, and other troubles

Forum for questions and support relating to the 1.24.x releases only.
Locked
playman
Posts: 4
Joined: Thu May 26, 2011 8:35 am

Error: failed to query crop capabilities, and other troubles

Post by playman »

Hi.
I'm trying to set up zoneminder on Ubuntu 10.04LTS
I used this instruction http://www.zoneminder.com/wiki/index.ph ... g,_etc.%29
The installation went trough with little hassle, but some.
now i'm stuck @ "Set up video sources" part.
when I try

Code: Select all

root@fjolsmidjan:/var/log/zm#  grep bttv /var/log/syslog
root@fjolsmidjan:/var/log/zm#
I get nothing, just soon as I press enter I get back into root.

now, if I do

Code: Select all

zmu -d /dev/video1 -q -v
I get this error

Code: Select all

Root@fjolsmidjan:/var/log/zm# zmu -d /dev/video0 -q -v
Error, failed to query crop capabilities /dev/video0: Invalid argument
Root@fjolsmidjan:/var/log/zm#
The service is running, atleast to my knowledge

Code: Select all

ZoneMinder Console - Running - v1.24.2
I searched for the crop error and found
http://www.zoneminder.com/forums/viewto ... 9472#59472
dclarke wrote:A USB camera that doesn't support cropping will produce an error message "Error, failed to query crop: /dev/video0: Invalid argument" from zmu -q -v.

Failures are exhibited in zmu, and other places that rely on LocalCamera::GetCurrentSettings.

The fault is in LocalCamera::GetCurrentSettings.

The error arises from the fact that ioctl VIDIOC_G_CROP returns -1 and errno = EINVAL to indicate that cropping is not supported. (Forum does not allow me to paste the link). LocalCamera::GetCurrentSettings treats any negative rc from ioctl VIDIOC_G_CROP as grounds for abnormal termination.

The fix is straightforward and short. All changes are in zm_local_camera.cpp as follows:

Code: Select all

911,912c911
< 	    int crop_rc = vidioctl( vid_fd, VIDIOC_G_CROP, &crop );
<             if ((crop_rc  < 0 ) && (errno != EINVAL))
---
>             if ( vidioctl( vid_fd, VIDIOC_G_CROP, &crop ) < 0 )
921,928c920,921
<             if ( verbose ) {
< 		if (crop_rc >= 0) {
< 	                sprintf( output+strlen(output), "  Current: %d x %d\n", crop.c.width, crop.c.height );
< 		}
< 		else {
< 			sprintf( output+strlen(output), "  Current: Cropping is not supported\n");
< 		}
< 	    }
---
>             if ( verbose )
>                 sprintf( output+strlen(output), "  Current: %d x %d\n", crop.c.width, crop.c.height );
I cant find zm_local_camera.cpp file so i'm stuck here to.


then I tried the fixx that willberg mentioned (about 13 post's down in the link above)
The config file I made did not work so I changed it according to aruzsi suggestion, then I was able to run the config

Code: Select all

root@fjolsmidjan:/home/playman# ffmpeg -r 15 -s 352x288 -f video4linux2 -i /dev/video0 //192.168.111.191:8090/feed1.ffm
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar 31 2011 18:53:20, gcc: 4.4.3
[video4linux2 @ 0x8f732c0][3] Capabilities: 5000001
-
It just seems to hang there doing nothing, until I press CTRL+C

Same as if I run

Code: Select all

playman@fjolsmidjan:~$ sudo ffmpeg -r 15 -s 352x288 -f video4linux2 -i /dev/video0 //192.168.111.191:8090/feed1.ffm
except I get

Code: Select all

[video4linux2 @ 0x93f82c0][3] Capabilities: 5000001
instead of

Code: Select all

[video4linux2 @ 0x8f732c0][3] Capabilities: 5000001
I'm now completly lost, I have no idea what to do next.
please bear in mind that i'm very new to ubuntu and linux
Any ideas?

EDIT
I forgot to mention that I have logitech QuickCam Pro 3000 (V-UF6)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Re: Error: failed to query crop capabilities, and other trou

Post by cordel »

You would have to build ZM from source to add the patch you quoted above.
playman
Posts: 4
Joined: Thu May 26, 2011 8:35 am

Re: Error: failed to query crop capabilities, and other trou

Post by playman »

Thank you for the reply cordel.
Is that the only way to get this no crop stuff fixed?
If I have to build ZM from source, that would mean that I have to remove the "old" zm then?

well I might aswell do a complete format then.

could you sugest a guide that would work for me?
as i've tried
http://www.zoneminder.com/wiki/index.ph ... g,_etc.%29
and
http://www.zoneminder.com/wiki/index.ph ... _Cambozola
but i've changed it accordingly as I dont have 64bit system
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Re: Error: failed to query crop capabilities, and other trou

Post by cordel »

Yes that is the only way to apply a patch.
Sorry but I have not tried either of those howto's so your on your own there.
Locked