views:

408

answers:

3

What is the best (and simplest!) way to record video from a webcam to the local filesystem--all from a browser? Ideally the video would be recorded in HD and then we could use ffmpeg later to convert it into the formats and sizes needed.

Here are some things we've looked into:

  1. Use Flash to stream to a local Red5 server. But we've had issues with video quality here.
  2. A Java applet using JMF (can we even write to the filesystem from an applet?). We've heard this might not be very efficient though. Can it handle HD?
  3. Write a custom Firefox plugin. Would this be very difficult?

Basically the hardest thing here is that the controls need to be embeddable into a browser. All we need is a box where the webcam frame is displayed to the user, and then some Javascript hooks so we can code start/stop buttons within the HTML page.

The computer is fully controlled (it's a kiosk) and we can do just about anything to it. We just need a solution that runs in the browser. Our current app is run in Firefox in kiosk mode and the webcam recording is just a part.

+1  A: 

The local Red5 looks like your best bet. Whatever quality issues you might have sound simpler to resolve than any of the other options.

Either pop by the Red5 mailing list and find out about tweaking quality or if you know enough Java have a go yourself.

Makes sense?

J

Zárate
A: 

If you have full access to the computer, you should use a desktop application to record the video. Recording video and local storage are both relatively difficult for a web application, and I don't think your solutions will be much more portable than a desktop application.

Evan Kroske
Unfortunately we can't. The video recording fits into a larger application run from the browser (in a kiosk mode), we can't interrupt the workflow to launch new apps or complicate it all by having the users switch back and forth or anything like that.
Christopher Nadeau
+1  A: 

Like others have mentioned, it is extremely difficult to write any file to the local filesystem from within a browser, due to security sandboxing. Your solution with Flash/Red5 is a good solution.

To resolve your issue of video quality, the Camera object has a function called setQuality. Depending on the capture resolution you want to use (which you set using Camera.setMode), it may be worthwhile to use some compression (for the same reason web servers use compression). You can disable compression altogether by using cam.setQuality(0,100). You should also take a quick look at the API in case I goofed.

Also, like Zárate mentioned, this may be a configuration issue with Red5. So if changing the quality in Flash doesn't help, check the Red5 Mailing Lists.

SEK