Invoke a camera to start in Drupal 7 Forms API
Have you tried the webcams module ? Even if it's dev I'd say it's worth trying.

Do a search on webcam on Drupal and try out some of the modules listed.

Else if you want to develop your own module then the best way is probably doing the integration of an existing webcam jquery module. (See some jquery plugin examples here)