Running Zoneminder and Motion together

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.
overly
Posts: 36
Joined: Mon Aug 20, 2007 6:14 pm
Location: Cleveland, Ohio USA

Post by overly »

If you can't get Motion and Zoneminder to simultaneously display a picture then its possible the V4L drivers don't do that for your equipment.
I've tried running them side-by-side but found that I can't get both to open the same video device simultaneously.

I may try again using the vloopback driver as described on the Motion website
Bluecherry PV-149 4-port capture card
Topica TP-936WIR-30C camera
Cheap Harbor Freight camera
HP Athlon 64 X2 w/ 2GB
Slackware 13 - 2.6.29.6-smp kernel
railgun
Posts: 2
Joined: Sun Oct 26, 2008 4:22 am

Post by railgun »

I have managed to get this working using a USB Webcam that cannot usually let 2 programs open the /dev/video1 device at the same time.

http://www.lavrsen.dk/foswiki/bin/view/ ... backDevice works for me ( compiling it can be a little tricky if you have never tried compiling a kernel module tho )

The thing is you also have to reverse the device order for it to work giving motion the primary control because it creates the vloopback pipe.

in /etc/modules i add vloopback ( you can modprobe it once compiled for testing but /etc/modules will put it in on restart as well )

The way vloopback works in this case is it adds /dev/video2 (input) and /dev/video3 (output) which motion uses to create a stream that zoneminder can use.

my camera is /dev/video1 . My motion.conf is similar in most settings to the example in the first post. The lines that differ are:

Code: Select all

videodevice /dev/video1
video_pipe /dev/video2
Then the most important part is to set the ZM Source settings for your loopback feed in zoneminder to the output pipe. ( the pipe is V4L1 even if the camera is V4L2 )

Code: Select all

/dev/video3 
video 4 linux 1         
PAL 
YUV420P
And voila ! motion triggering ZM on a webcam. Anyone with say 2 webcams can increase the number of loopback pipes by putting

Code: Select all

vloopback pipes=2
into /etc/modules and creating an extra motion thread.

Many thanks to Sledgehammer for saving me 10% CPU and digging through 600 false triggers on a sunny day !!

nb. copying and pasting the $ /usr/bin/zmsend.pl “1|on|500|Testâ€
dasbooter
Posts: 10
Joined: Sat Jun 11, 2005 4:37 pm

Post by dasbooter »

Well I have 2 cameras running thru motion and piping outputs to zone minder but I have a little problem. The zmsend script doesnt tell which camera to record. If I wave my hand in front of camera 2 then camera 1 records.I think I need two zmsend scripts one for each camera and then I could put a call for each script in the cameras thread.config. Maybe there is some changes for zmtrigger too I am not sure. One thing for sure

Code: Select all

/usr/bin/zmsend.pl “1|on|500|Testâ€
littlej
Posts: 68
Joined: Sun Oct 18, 2009 11:46 am

Post by littlej »

hy, i have a problem canot get zm runing with the vloopback, i succesfuly added the module, modprobed with pipes=2 and i use video_pipe /dev/video8 and in zm /dev/video9. tryed all the modes in zm, v4l1 and all color modes, but none its working...can u asist somehow? how can i check what video modes are suportet by the vloopback device? thanks
Post Reply