Error, failed to query crop /dev/video0: Invalid argument

Forum for questions and support relating to the 1.24.x releases only.
Locked
clytle374
Posts: 8
Joined: Mon Sep 06, 2010 3:44 am

Error, failed to query crop /dev/video0: Invalid argument

Post by clytle374 »

I've been playing with ZM all day trying to get a feel for it before making any hardware purchases. I plan on using several USB webcams in addition to at least a 4 port card to save some money. (Am I asking too much from the CPU for motion detect?)

I started with apt-get zoneminder on Ubuntu 9.04 and got the

Code: Select all

Error, failed  to query crop /dev/video0: Invalid argument
message on 2 webcams I tried. Then went to my netbook running the latest stable Ubuntu, same thing with both USB webcams I tried earlier plus the internal one. Updated the netbook with 10.10 for the fun of it with the same results.

Anyway, the real question is this: Is there an expected release date for a fix? Is the SVN repository considered stable? Just asking since I haven't built much source on Ubuntu and am thinking of getting a Gentoo box up and running for the project.

Thanks
jfkastner
Posts: 74
Joined: Wed Jun 17, 2009 11:52 pm

Post by jfkastner »

some USB cams don't have the crop command properly built in, so they fail - i believe it's a cam problem and not ZM - there are many posts here in the ZM forums about it. try a different resolution and see if that works for your cam

also you may run into trouble running several USB cams - depending on your motherboard ALL USB ports go thru one internal hub, and then the cams can't reserve enough needed bandwidth to function - a fix would be to buy a USB card - pci will do - and connect some cams to it and some to the motherboard

another tip is buy only UVC cams (google eg logitech UVC) and you'll have a lot less problems than with cheaper no-name-chips that are not well built or supported
pls send emails to 'myusername at google dot com'
clytle374
Posts: 8
Joined: Mon Sep 06, 2010 3:44 am

Post by clytle374 »

There is a fix and it looks like it is included in the svn version to not error if crop isn't available. Wondering if that would be released soon, I looked and didn't see any mention of when the next release might be.

I'm trying to compile the source(either a patched 1.24.2 or svn) right now and am experiencing difficulties. I switched back to Gentoo since I'm more comfortable with it building software.

I might look into some other webcams, was just hoping I could use the 'misc junk' I've got on hand. I'll check into the UVC

thanks
clytle374
Posts: 8
Joined: Mon Sep 06, 2010 3:44 am

Post by clytle374 »

Anyone got a hint to offer about this error when building the svn version?

Code: Select all

rm -f ".deps/zm_local_camera.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include  -frepo -g -O2 -MT zm_monitor.o -MD -MP -MF ".deps/zm_monitor.Tpo" -c -o zm_monitor.o zm_monitor.cpp; \
    then mv -f ".deps/zm_monitor.Tpo" ".deps/zm_monitor.Po"; else rm -f ".deps/zm_monitor.Tpo"; exit 1; fi
zm_monitor.cpp: In member function 'void Monitor::SingleImage(int)':
zm_monitor.cpp:3688: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
zm_monitor.cpp: In member function 'void Monitor::SingleImageRaw(int)':
zm_monitor.cpp:3711: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
zm_monitor.cpp: In member function 'void Monitor::SingleImageZip(int)':
zm_monitor.cpp:3737: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include  -frepo -g -O2 -MT zm_mpeg.o -MD -MP -MF ".deps/zm_mpeg.Tpo" -c -o zm_mpeg.o zm_mpeg.cpp; \
    then mv -f ".deps/zm_mpeg.Tpo" ".deps/zm_mpeg.Po"; else rm -f ".deps/zm_mpeg.Tpo"; exit 1; fi
zm_mpeg.cpp: In member function 'void VideoStream::SetupFormat(const char*, const char*)':
zm_mpeg.cpp:50: error: 'av_guess_format' was not declared in this scope
make[2]: *** [zm_mpeg.o] Error 1
make[2]: Leaving directory `/root/zm/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/zm'
make: *** [all] Error 2
382527398571
Posts: 10
Joined: Thu Aug 26, 2010 9:41 pm

Post by 382527398571 »

http://archives.free.net.ph/message/201 ... 47.en.html

Code: Select all

$ grep -R av_guess_format ./ | grep -v '/\.svn\/'
./src/zm_mpeg.cpp:      of = av_guess_format( format, NULL, NULL);
./src/zm_mpeg.cpp:              of = av_guess_format("mpeg", NULL, NULL);
$

Code: Select all

$ svn diff -r 3017:3018 src/zm_mpeg.cpp
Index: src/zm_mpeg.cpp
===================================================================
--- src/zm_mpeg.cpp     (revision 3017)
+++ src/zm_mpeg.cpp     (revision 3018)
@@ -46,11 +46,11 @@
        format = p_format;

        /* auto detect the output format from the name. default is mpeg. */
-       of = guess_format( format, NULL, NULL);
+       of = av_guess_format( format, NULL, NULL);
        if ( !of )
        {
                Warning( "Could not deduce output format from file extension: using mpeg" );
-               of = guess_format("mpeg", NULL, NULL);
+               of = av_guess_format("mpeg", NULL, NULL);
        }
        if ( !of )
        {
@@ -102,8 +102,10 @@
                   of which frame timestamps are represented. for fixed-fps content,
                   timebase should be 1/framerate and timestamp increments should be
                   identically 1. */
-               c->time_base.den = (int)(frame_rate*100);
-               c->time_base.num = 100;
+               //c->time_base.den = (int)(frame_rate*100);
+               //c->time_base.num = 100;
+               c->time_base.den = frame_rate;
+               c->time_base.num = 1;
 #else
                /* frames per second */
                c->frame_rate = frame_rate;
$
Locked