This discussion is archived
4 Replies Latest reply: May 7, 2012 6:23 AM by 798853 RSS

Applet Photo Booth

798853 Newbie
Currently Being Moderated
Hi there ,

I need one help from you guys ,

I am struggling to build photo booth applet , basically I am try to make application access to the local webcam , gram frame from webcam and display it to the user after I added effect on it .

In additional I made the application with JPannel and swing components , but client need to be applet and run it in the browser , when I try to access to webcam via applet it will get access error , I know I have to sign the applet and etc , but even with the sign application wont work, I

Anybody can give me idea regarding this issue ?

Many Thanks in advance .
  • 1. Re: Applet Photo Booth
    935476 Newbie
    Currently Being Moderated
    I created an app in JMF that accesses the webcam, the deployment was via java webstart.
    It is very important that you sign ALL jars that are required by the app; however I chose not to use an applet for the app as a thick client was far better and java web start can update your app whenever a new version is available.
  • 2. Re: Applet Photo Booth
    798853 Newbie
    Currently Being Moderated
    Hi ,

    I have to inform you , I could made the JApplet which work fine to access local webcam , You are right I need to sing the jar file , but there is some other issue which you need to add one more line into your code before you call frame grab method .
      System.setProperty("java.class.path", "C:\\Program Files (x86)\\JMF2.1.1e\\lib\\jmf.jar");
    There is other problem I am facing now .Which could not find the answer for it . I want to access two webcam at same time with my application , But some how I get error and would not let me to connect to both camera in same time .

    Any idea ?

  • 3. Re: Applet Photo Booth
    935476 Newbie
    Currently Being Moderated

    Unfortunately I only have one webcam so I cant test this myself, but I assume you can change the int value in the mediaLocator; in the below code its 0 maybe try add another mediaLocator with the value of 1?

    String strDevice = "vfw:Microsoft WDM Image Capture (Win32):0";
    mediaLocator = new MediaLocator("vfw://0");

    you will probably need multiple instances of player too (for each mediaLocator)
    player = Manager.createRealizedPlayer(mediaLocator);

    //Something like this....
    String strDevice0 = "vfw:Microsoft WDM Image Capture (Win32):0";
    mediaLocator0 = new MediaLocator("vfw://0");
    player0 = Manager.createRealizedPlayer(mediaLocator0);

    String strDevice1 = "vfw:Microsoft WDM Image Capture (Win32):1";
    mediaLocator1 = new MediaLocator("vfw://1");
    player1 = Manager.createRealizedPlayer(mediaLocator1);

    If I can get my hands on another webcam I will try it myself; I hope you get it to work.
  • 4. Re: Applet Photo Booth
    798853 Newbie
    Currently Being Moderated
    It did work on that way , I know I am doing something silly . that's why it create problem .

    Other thing I am trying but nowhere could find anything about it . Is I have 2 IP Camera and I would like to capture stream from it . Then display it . But no hope . Did you try before ?

    I have both camera public and accessible from internet . I can capture MotionJPG by using normal 2D java but because it is loading image by image and draw it in the screen . roughly display 4 frame per second which not acceptable for my project .

    Any body can help to sort it out with JMF ?


  • Correct Answers - 10 points
  • Helpful Answers - 5 points