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
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â€