We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Webcam input in web browser
Page Index Toggle Pages: 1
Webcam input in web browser (Read 3647 times)
Webcam input in web browser
Feb 4th, 2009, 12:29am
 
Hello everyone,

I have an idea to provide sketches with webcam/video libraries to be used in browsers (hence openprocessing.org): We all know that browsers don't allow java applets to access hardware input like webcam, which makes it impossible to use webcam/focused sketches, but it is possible with Flash. so the idea is:
First to put a flash object into html that fetches the webcam input (and even microphone) and keeps the last frame pixels in an array. Then, the processing sketch that is embedded to the page and using a special video library (to be developed) can ask this frame from Flash using external javascript call functions. So that the webcam info can be carried from Flash through html-javascript to Java Applet. (I know that both flash and java applets can call external javascript function on the webpage).
Any ideas? Do you think it would work? Any leads? Did somebody try this before?

Re: Webcam input in web browser
Reply #1 - May 14th, 2009, 7:47am
 
Hey everyone,

I finally had time to work on this, and wanted to share it with you; I tried to bridge Camera input from Flash to a Processing sketch. It is simply an extended "video" library with the same functions, except that in browser it connects to a flash element on the same page instead of a 'capture' device, using javascript (in browser) as a bridge. So one needs to use this library instead of video library + a webpage with specific javascript in it + a specific flash file that connects to camera.

Here is an example:

http://www.openprocessing.org/testSpace/webcamExample.php
(using Daniel Shiffman's example from Processing)

Though there are problems as you might expect: Performance, and browser compatibility seems to be the first comers. But if we (the community) can work on this together, I think those issues can be fixed one by one. And I think even live audio input through minim would be possible (I don't know much about minim though).

Please let me know if it works on your browser/OS. Currently works fine in Firefox 3 + MacOS X.
Re: Webcam input in web browser
Reply #2 - May 23rd, 2009, 4:52am
 
Hi,

I'm not sure if this'll work, or if it's even relevant to you.
A signed applet will have much less security issues and might allow you to access the webcam.
Have you looked into this?
Re: Webcam input in web browser
Reply #3 - May 27th, 2009, 1:50pm
 
Hi Andreas, thanks for your input. I know it is possible to sign the applet to enable such features, but it is a pain in the ... to do that, and one needs to sign an applet after every export etc.. Sun and Java definitely didn't make any easy for us to be more innovative using those device input-output features etc..
Right now seeing Adobe Flash doing all the tricks that Java can't do, I am trying to find an easier way, so that even beginners in Processing can share their camera stuff. If I can manage, I would also like to incorporate it to OpenProcessing, so that everyone can share their cool stuff using webcam & sound input.

By the way, do you know if I can sign an applet without recompiling it?
Page Index Toggle Pages: 1