Easy to turn an old Android phone into a webcam (I wrote this up for a less tech-savvy friend): http://teadragon.org/?q=content/turn-old-android-phone-or-ta...
Once set up, you can plug the stream into a security software on a PC or NAS to record the stream, detect motion, etc.