File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes connect a webcam via java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "connect a webcam via java" Watch "connect a webcam via java" New topic
Author

connect a webcam via java

Harry Tuttle
Greenhorn

Joined: Apr 08, 2010
Posts: 24

as a java developer i want to make a connection to my webcam from java using the java media framework. and here is my problem: when i create an instance of MediaLocator i use the same url my brower use to display the video image, but this url cause an error "The URL may not exist. Please check URL". i can't figure out what's going wrong. any ideas how the url must look?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
What does the URL that works on the browser look like?

Where, exactly, do you get this error message?

Bill
Harry Tuttle
Greenhorn

Joined: Apr 08, 2010
Posts: 24
William Brogden wrote:What does the URL that works on the browser look like?

Where, exactly, do you get this error message?

Bill


this is the method to initialize the cam



the ml, ds and player are fields of the class. and here is the output of the printStackTrace():



William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
String mediaFile = "http://192.168.2.108/img/main.cgi?next_file=main.htm";


That sure looks like the URL for a HTML page - your browser probably understands that and extracts the real URL of the image file in order to make a request for the image data.

If this was my problem I would examine the source on the browser to see what it is really doing.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connect a webcam via java