dont think you need to write the app cos it is allready done its called motion works best on ubuntu its in the repos you can record from multiple ipcamers webcams anything you can save it as video or...