This content has been marked as final. Show 4 replies
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.
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 .
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 .
System.setProperty("java.class.path", "C:\\Program Files (x86)\\JMF2.1.1e\\lib\\jmf.jar");
Any idea ?
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.
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 ?