Webcam Snapshot is a small block available on Moodle plugin’s database through which you can directly capture your picture from your webcam to set your moodle profile picture; courtesy Luuk Verhoeven.
Webcam Snapshot block is available for Moodle 2.6 and above versions with a total download count of 100 till date.
It works using Flash and needs permissions to access your Camera and Microphone. Once permitted all you need to do is to select the camera device under the “Please select your camera device menu” and then click “Save Snapshot” and it will automatically save the picture as your profile pic.
You can download the plugins from :
https://moodle.org/plugins/view/block_mfavatar
And if you need a quick setup tutorial then you can watch the video on youtube: