Decent surveillance camera setup is quite costly and probably not worth for personal use. Anyway there is always alternative. With cheap Raspberry Pi and camera module you can build customizable surveillance camera that will record HD video. Since Raspberry Pi is a Linux machine, you can do lots of crazy stuff with it. Scavix have written a guide how to set up a camera that would stream live video to web and would be triggered to record on motion detection.
The setup is pretty straight forward. It uses all accessible parts like Raspberri Pi with camera module, small USB based WiFi adapter, SD flash card and micro SUB power adapter. And proper case especially if camera is used outdoors. He used open source software for detecting motion (which is also called motion). It simply detects if video image has significantly changed and sends trigger event – start recording in this case. Recorded files are stored in Windows shared folder as SD memory is pretty limited and fills up quickly. With proper configuration it is also possible to access live stream from any browser. There is more ways to improve the camera for instance sending notifications when motion is detected, add additional external sensors like temperature. And to be on safe side there could be battery pack included in case someone would cut the power.