File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Displaying WebCam video in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Displaying WebCam video in JSP" Watch "Displaying WebCam video in JSP" New topic

Displaying WebCam video in JSP

Siddhesh Deodhar
Ranch Hand

Joined: Mar 05, 2009
Posts: 118
Hi all,

I was trying to display a live video from Web Cam into a jsp page(Jsp and webcam are on same machine).

Initially I played with JMF API and was able to get access to web cam using Java class.
Then I returned to JSP, and tried displaying a simple video(saved on my Hard Disk) into it using HTML <object>

Now I wanted to integrate above two things. I tried to do it with what ever knowledge I have but could not succeed.

Went on the Net to search if anyone trying similar things. In some forum, for similar question I found reply as follows

Create a java application which can capture the video from your webcam.
Once done that, create a servlet which gets an inputstream from it and writes it to the outputstream of the response.
Once done that, embed a player in your JSP which points to the servlet and supports the stream format in question.

I am unable to grasp last line of above paragraph "Once done that, embed a player in your JSP which points to the servlet and supports the stream format in question."

Can anyone put light on this ?

Note: I don't want to display web cam video in Applet.

Good, Better, Best, Don't take rest until, Good becomes Better, and Better becomes Best.
Sidd : (SCJP 6 [90%] )
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42956
If you do not want Java on the client (which is understandable), then you need some other player; the major choices are Flash, QuickTime and Silverlight. The latter two are not always available, so which is best depends on your target audience; Flash may be best in the general case.

You also need a server component that streams the feed from the webcam to all clients that connect to it.
subject: Displaying WebCam video in JSP
It's not a secret anymore!