IPcams , 500w , V4l2 and Zoneminder

ok so a wired title , i just wanted a title that lets you know what the post is about.

i decided i was going to make a homes security / surveillance system, of course i obviously wanted to do this with linux.
i did a little research and price comparisons , i found that there was linux software for this …namely zoneminder. thats IPcams are still expensive and are a bit like webcams in the compatability with linux department .i settled on the airlink101 skyipcam500w.

these are a relativly inexpensive ipcam they dont actually stream avi they stream mjpeg wich seems to be the rapid succesion of jpeg images , there are issues with this in zoneminder , especialy on this model.
zoneminder can however pick up the single jpeg from this cam.

so i ordered all the things and they have nearly all arrived , 1 new cheap compaq box and 4x ip cams .
as i mentioned in an earlier post i had dumped vbox for vmware , so i setup zoneminder in vmware.
configured all the cams and placed them then set about connecting them to zoneminder vm.
This didnt quite go as planned the mjpeg didnt show in zoneminder , neither did the regular jpeg , this was a dissapointment for me , but i had noticed other input types on te zoneminder setup.

zoneminder can take a V4L2 device as input so i wondered if i could somehow show the ipcam as a local V4l2 device. hence 2 days of googling and finding out things .

The Hack
so far we know the mjpeg doesnt play well with linux , i cant stream it through any players and can only view it in a browser with the aid of java, however i can get a single jpeg from the camera .

i wrote a little python prog to get the images form the camera and display them in rapid succession to give the ilusion of a streamed video ……i did this very easily and it worked perfectly

so now i wanted to somehow output that feed to an avi on the fly and pass it to zone alarm ……this didnt really seem possible without saving the avi file and it becoming huge , as i wanted to jsut loop it and have no saved files this didnt seem like it would work.

so what i decided on was to try to loop the output as a V4l2 device

V4l2 loopback
i did some googling and found a loopback driver for V4l2 so i downloaded it to test it ,but didnt work on my ancient kernel its only for very new kernels , luckily the vm that zoneminder is on is built with jaunty  so it worked .
they sugest feeding the loopback with an application they also make so i downloaded that too after some messing around with it it seemed to work . i changed the script to jst dump the jpeg  to a file and set the loopback device to  collect the jpeg as input , the script continues runningchanging the input file .

now i think this should work , when i conenct a view to the device it does connect and get now errors from the viewer or the loop back devie or the feed application …..i just get no picture ……so i tried my regular laptop webcam (V4l2 compatable) and with the viewer here i just get the same …… so i am thinking it is a vmware problem …so i need some dedicated hardware to try it on , i do have the new machine i bought but …………i didnt get a vga cable for it …ordered one but its taking ages to arrive 😦

so i guess i just have to wait and see what happens with dedicated hardware , to test that …….i am thinking it should work ……unless i am over looking something like you cant change the file when the input has been set ?…….but if that was the case i think i woudl have goten errors by now  so we will see.

as for zoneminder that didnt pic up video from my webcam either ……i think zoneminder doesnt like the virtual enviroment too much either ……..will have to try them both on dedicated hardware.

so i will keep you guys posted

Read and post comments | Send to a friend


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: