4

I'd like to allow users to record videos directly from their webcam. I haven't done much work with PHP but am stuck with it for this project. We currently have a system in place for video uploading and encoding, but nothing to actually access a user's webcam. How would you recommend I proceed?

btw
  • 7,006
  • 9
  • 40
  • 40
  • check this out guys!! worked for me http://code.google.com/p/jpegcam/ – Tony Jose May 14 '12 at 07:06
  • as an end user, I would feel very worried if I thought a web site could access my webcam. The privacy implications to this concept are scary. – Spudley May 14 '12 at 19:40

5 Answers5

12

Webcams aren't available to HTML or JavaScript/DOM in any browsers that I know of, so you're going to end up dependent on some sort of plugin. I'd recommend you start your search with Adobe Flash/Flex, though It's possible that Microsoft Silverlight is able to do the same thing. Flex is a bit more reliable technology and has been around longer, but Microsoft is pouring a ton of money into Silverlight, and I expect it to improve radically over the next few years.

Adam Ness
  • 6,224
  • 4
  • 27
  • 39
  • From what I've heard, Silverlight does not (at this time) allow access to mic's or web cams. – MattBelanger Oct 21 '08 at 00:23
  • I've actually managed to do exactly this with Drupal. Blogged about doing this at http://davidwees.com/myblog . – David Wees Mar 17 '09 at 14:04
  • It sounds like the OP was asking about accessing the webcam on the end user's site, not streaming from a single webcam attached to the server. However, Red5 is definitely an affordable option for streaming from the server side. – Adam Ness Jan 07 '12 at 17:15
  • 4
    This information is outdated. Webcams can be accessed via JavaScript nowadays. – Gordon Aug 18 '13 at 10:56
5

You need client side technology -- PHP is server side. Check out Adobe Flash/Flex. I don't know anything about Microsoft Silverlight.

Terminus
  • 902
  • 2
  • 10
  • 21
1

Check out the mugshot module on Drupal.org. It uses a flash widget to do the image capture, then saves the image as a node. Its code can almost certainly be mined for useful functions if you need to do something similar.

Eaton
  • 7,405
  • 2
  • 26
  • 24
0

The browser itself cannot access a user's webcam. There are proposals for a new type of input field to support this, but is is not currently available. You'd have to do it through a plug-in.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
0

You can't access to underlying hardware objects from a server side scripting language. If you are insterested into access to hardware devices so you have to use "browser components" like adobe flash , active X object, java applets, etc.