V4L2 Support with ZoneMinder 1.22.x

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
slbpatrol
Posts: 9
Joined: Sat Feb 03, 2007 10:12 pm

V4L2 Support with ZoneMinder 1.22.x

Post by slbpatrol »

I have managed to get some code for V4L2 support. I have re-written portions of ZoneMinder to support V4L2. If anyone is interested in helping me test it I will be glad to send you the code. I currently have two Logitech Cameras, Logitech Orbit (V4L and V4L2) and Logitech Orbit MP (V4L2 only). I have removed support for V4L (unless someone knows how to allow both or write code to allow both). I am trying to determine why the MP only shows at 176 x 144. I believe it has something to do with the uvc driver.
dedmeet
Posts: 21
Joined: Sat Sep 08, 2007 9:38 pm
Location: Australia

Yes please

Post by dedmeet »

Hi,

I also have the orbit with uvc drivers. I can do some testing and help.
I am currently working on improving the uvc_stream software to allow camera control (actually got that working lastnight)

See my post here

http://www.zoneminder.com/forums/viewtopic.php?t=9885

My way is a workaround, been waiting for the v4l2 support, and can try and help. Not a C developer, but do Delphi, but I can get my way around the c, just takes a bit of googling to get to understand the command syntax.

If you make the code available for download somewhere. (or even better, some kind of version control repo ? (subversion?)
slbpatrol
Posts: 9
Joined: Sat Feb 03, 2007 10:12 pm

ZoneMinder uvc Development Code Download

Post by slbpatrol »

You can get the development code from here:

http://home.triad.rr.com/metslb/webfiles/

I do not know how to use svn repositories yet.
slbpatrol
Posts: 9
Joined: Sat Feb 03, 2007 10:12 pm

V4L2 Update on Logitech Quickcam MP

Post by slbpatrol »

I have determined that the Logitech Quickcam MP (046d:08cc) uses two formats, YUYV and MJPEG. The YUYV will only display the images at 176x144 while the MJPEG allows up to 640x480. I am currently looking for code the will convert from mjpeg to rgb24. I have seen come code that will do this but it is part of an application that seems to include serval files. All I am interested in is the mjpeg to rgb24 conversion. If anyone has any code or that can point me into the right direction I will greatly appreciate it.
dedmeet
Posts: 21
Joined: Sat Sep 08, 2007 9:38 pm
Location: Australia

Re: V4L2 Update on Logitech Quickcam MP

Post by dedmeet »

slbpatrol wrote:I have determined that the Logitech Quickcam MP (046d:08cc) uses two formats, YUYV and MJPEG. The YUYV will only display the images at 176x144 while the MJPEG allows up to 640x480. I am currently looking for code the will convert from mjpeg to rgb24. I have seen come code that will do this but it is part of an application that seems to include serval files. All I am interested in is the mjpeg to rgb24 conversion. If anyone has any code or that can point me into the right direction I will greatly appreciate it.
Hi, will grab the code soon, and have a play. I just finished adding functionality to uvc_stream (by Tom Stoeveken (http://naaa.de/uvc_streamer.htm) to allow motor control, waiting to hear what he thinks.

If you have a look at his code (it streams jpeg at 640x480), it may give a clue what is needed.

Won't actually get to your code in a few weeks, as I have two websites that I have to complete, so my free time has now become limited for a while :(

Lucas
RoundSparrow
Posts: 23
Joined: Thu Oct 18, 2007 2:11 pm

Post by RoundSparrow »

I have a couple newer Logitech cameras that only work via the uvc_streamer hack... would love to see native support. Any progress?
slbpatrol
Posts: 9
Joined: Sat Feb 03, 2007 10:12 pm

V4L2 Support with ZoneMinder 1.23.x

Post by slbpatrol »

I have finally incorporated V4L2 support for Zoneminder. Please feel free to test the development source at http://mysite.verizon.net/brownslb/zoneminder/.
only4john
Posts: 5
Joined: Wed Jan 23, 2008 9:42 pm

trouble with PixelFormats.c

Post by only4john »

Dear slbpatrol,

Thank you for developing the v4l2 support to Zoneminder, and leave me
a message in the zoneminder forum. I tested the latest version which
is ZoneMinder-1.23.1a.devel.tgz downloaded from your site
http://mysite.verizon.net/brownslb/zoneminder/. However, it can't pass
through the Make.

sudo ./configure --with-webdir=/var/www/html/zm
--with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data
--with-webgroup=www-data --with-ffmpeg=/opt

goes perfectly, and I've installed the mjpegtools from synapic pkg
manager beforehand.(and also I tried from source, the same)

but when I do the
sudo make, I got

"
make all-recursive
make[1]: Entering directory `/home/itc/download/ZoneMinder-1.23.1.devel'
....
....
mv -f .deps/zm_buffer.Tpo .deps/zm_buffer.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/opt/include -g -O2
-MT PixelFormats.o -MD -MP -MF .deps/PixelFormats.Tpo -c -o
PixelFormats.o PixelFormats.c
PixelFormats.c: In function 'mjpegtoyuv420p':
PixelFormats.c:406: error: 'uint8_t' undeclared (first use in this function)
PixelFormats.c:406: error: (Each undeclared identifier is reported only once
PixelFormats.c:406: error: for each function it appears in.)
PixelFormats.c:406: error: 'yuv' undeclared (first use in this function)
PixelFormats.c: In function 'mjpeg_to_rgb24':
PixelFormats.c:447: error: 'DHT_SIZE' undeclared (first use in this function)
PixelFormats.c:449: error: 'HEADER' undeclared (first use in this function)
PixelFormats.c:450: error: 'DHT_DATA' undeclared (first use in this function)
make[2]: *** [PixelFormats.o] Error 1
make[2]: Leaving directory `/home/itc/download/ZoneMinder-1.23.1.devel/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/itc/download/ZoneMinder-1.23.1.devel'
make: *** [all] Error 2

" and I couldn't go on. where do you think the problem is? I did a
google on PixelFormats.c error, but no supports on that.

Thank you for your reply. My Logitech AF (064d:0994) is still sleeping
on my desktop ;)

Best Regards,

Fei
solidd_swa
Posts: 2
Joined: Fri Apr 18, 2008 12:25 pm

any clues yet?

Post by solidd_swa »

hey, any clues on how to solve that last make problem?

I am installing zoneminder for my job, and time is short, and i cant seem to find the problem?
solidd_swa
Posts: 2
Joined: Fri Apr 18, 2008 12:25 pm

Post by solidd_swa »

so, i was debugging. and found that
PixelFormat.c (or .h) was missing #include <stdint>
that solved the first error.

and for some reason when i put #include "huffman.h" in the .h file, it solves the other 2 problems.

but now, i am faced with this

make[2]: Entering directory `/home/technomedia/Desktop/ZoneMinder-1.23.1.devel/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -g -O2 -MT zm_remote_camera.o -MD -MP -MF .deps/zm_remote_camera.Tpo -c -o zm_remote_camera.o zm_remote_camera.cpp
mv -f .deps/zm_remote_camera.Tpo .deps/zm_remote_camera.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -g -O2 -MT zm_monitor.o -MD -MP -MF .deps/zm_monitor.Tpo -c -o zm_monitor.o zm_monitor.cpp
zm_remote_camera.h:51: error: expected identifier before numeric constant
zm_remote_camera.h:51: error: expected `}' before numeric constant
zm_remote_camera.h:51: error: expected unqualified-id before numeric constant
zm_remote_camera.h:51: error: cannot declare variable ‘state’ to be of abstract type ‘RemoteCamera’
zm_remote_camera.h:34: note: because the following virtual functions are pure within ‘RemoteCamera’:
zm_camera.h:73: note: virtual int Camera::PreCapture()
zm_camera.h:74: note: virtual int Camera::PostCapture(Image&)
zm_remote_camera.h:53: error: expected unqualified-id before ‘protected’
zm_remote_camera.h:152: error: expected unqualified-id before ‘public’
zm_remote_camera.h:154: error: expected constructor, destructor, or type conversion before ‘;’ token
zm_remote_camera.h:156: error: non-member function ‘const char* Host()’ cannot have cv-qualifier
zm_remote_camera.h: In function ‘const char* Host()’:
zm_remote_camera.h:156: error: ‘host’ was not declared in this scope
zm_remote_camera.h: At global scope:
zm_remote_camera.h:157: error: non-member function ‘const char* Port()’ cannot have cv-qualifier
zm_remote_camera.h: In function ‘const char* Port()’:
zm_remote_camera.h:157: error: ‘port’ was not declared in this scope
zm_remote_camera.h: At global scope:
zm_remote_camera.h:158: error: non-member function ‘const char* Path()’ cannot have cv-qualifier
zm_remote_camera.h: In function ‘const char* Path()’:
zm_remote_camera.h:158: error: ‘path’ was not declared in this scope
zm_remote_camera.h: At global scope:
zm_remote_camera.h:159: error: non-member function ‘const char* Auth()’ cannot have cv-qualifier
zm_remote_camera.h: In function ‘const char* Auth()’:
zm_remote_camera.h:159: error: ‘auth’ was not declared in this scope
zm_remote_camera.h: In function ‘void Terminate()’:
zm_remote_camera.h:162: error: ‘Disconnect’ was not declared in this scope
zm_remote_camera.h: At global scope:
zm_remote_camera.h:170: error: expected declaration before ‘}’ token
zm_remote_camera.h: In constructor ‘RemoteCamera::RemoteCamera()’:
zm_remote_camera.h:34: error: no matching function for call to ‘Camera::Camera()’
zm_camera.h:51: note: candidates are: Camera::Camera(Camera::SourceType, int, int, int, int, int, int, int, bool)
zm_camera.h:34: note: Camera::Camera(const Camera&)
zm_remote_camera.h: At global scope:
zm_remote_camera.h:51: note: synthesized method ‘RemoteCamera::RemoteCamera()’ first required here
make[2]: *** [zm_monitor.o] Error 1
make[2]: Leaving directory `/home/technomedia/Desktop/ZoneMinder-1.23.1.devel/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/technomedia/Desktop/ZoneMinder-1.23.1.devel'
make: *** [all] Error 2

any ideas? its way beyond my scope here
only4john
Posts: 5
Joined: Wed Jan 23, 2008 9:42 pm

Post by only4john »

instead of using ./configure, but use ./configure.sh (edit it first to fit your needs), it may solve all the problems.
Post Reply