Record video clip from webcam in Drupal 7 custom module
There is Media: Webcam


  This project (still under active development) will add a Webcam
  capture tool for video and images to FileField. Video requires a Red5
  or Flash Media server to also be available; documentation for this
  coming soon enough.


Browse the SOURCE to get some inspiration.