Webcam live streaming in a Java webapp - java

Ok, I know this is probably not so easy but I have this requirement. Basically the webapp will have a simple jsp with a live streaming webcam. How can I get the stream and embed it in the application?
I've read about RTPS and Red5 and stuff like that but seems not so easy to find a simple and clear tutorial on how to do this!
Btw I'm open to evrything else (like http streaming? flash?). The simpler, the better!
Thanks in advance!

Related

How to get logs and display them on a web using Java (basic Java)

I have logs that I want to show on a web browser. ( The source code is using Log4j for logging.) I know where the logs are created. I want to code in java to display them on a web.
Can you give me some tips on Java coding ? (what class or API do I use to read the logs and display them)
Simple solution: You can go ahead creating a Controller which can read from the log file and provide you insights as a huge String(JSON).
Solution you can try implementing on your own: http://logging.apache.org/chainsaw/2.x/ to give you a headstart. Try to make this(Without UI,of course) with your log file. Believe me, you can learn a lot if you do this.
Solution I'd prefer: I'd suggest you implement https://www.elastic.co/products/kibana to aid you from your application tier. This also has steep learning curve for you if you are newbie. Good luck!

How can I stream video to a browser using Java/Spring?

We a have jboss server running and have a basic web setup using Spring but now I would like to stream video into the browser. I am trying to use xuggle but then I read on their website that you can't put it into an Applet or use it with java webstart, so I'm assuming that means I can stream to a browser, is this assumption correct? If so does anyone else know any libraries or how I should go about doing this? If you need any more info or have questions I'll be happy to answer although I'm very new to streaming video and relatively knew to Spring.
UPDATE: So I'm able to generate a video using xuggle, and then I can embed that video in my html code... but I can't generate and stream at the same time. Does anyone have any ideas how to make xuggle push date out to my tomcat server?
You may want to look at Red5 media server.
Since you are doing jsp, just have your code write out the HTML 5 video element. That will provide basic video functionality. This will work in all HTML 5 compliant browsers as well as all mobile devices.

Uploading Files with different formats to a URL using Java client

I need to write some code in Java to upload a file(.tz format) to a URL(prqs#vks.com) by using HTTP PUT/POST and SMTP.I have no idea how to do this and my application is not a web based application i have to write a pure java client to do this. I searched the net but could not find a suitable tutorial on how to do this also i found a lot of stuff where in they are uploading file using a HTML form to a server. but that is not what i want.
Can you please let me know how this is to be done. If you can direct me to a tutorial or provide any sample code then it would be very helpful. I am scratching my head on this for a long time now.
Thanks
vikeng21
I do this all the time from a server side Java Application.
If what your asking for is creating an e-mail with an attached file in .tz format then there are some good resources out there.
I personally used the JavaMail API. It comes with attached JavaDoc and examples. Take a look at the samples in the demo directory within. Hopefully it should help you out.
Java Mail API
You can try out Apache Commons Fileupload for uploading files.
Have a look at this example as well. This might work for you

Java - XMPP - I need some document or tutorial for it

i found XMPP on google (i need create a application IM look like Yahoo or Live or Pidgin), i need write XMPP Server and Client but i don't know how to write it?
because of it, it need some document or tutorial help me write server and client interactive with my database.
Thank you
Best Regards!
Either you can write your own or use the already proven open source libraries ready to be used. Look this post Good XMPP Java Libraries for server side?
If you are looking for tutorials, articles etc then go to xmpp.org or go to this post Good tutorials on XMPP?
You can also try writing server components with Whack framework. I've blog about using Whack here (part1, part2, part3).

How to upload and stream flash videos using java?

I want to create a html page that can be used to upload videos and also able to playback the videos. I am totally new to this. 2 weeks before only i learnt uploading and processing images. So, i need some guidelines like
How to upload video?
what concepts i have to learn?
what are all the libraries i may require?
How to convert it into flash format?
How to stream it back to user?
I am using Java in server side!
And i also want to know that Is there any way to do them all with AJAX?
Any suggestions or advices or links or anything that can help me would be more appreciative!!!
Thanks in Advance!
Hmmm... seems interesting..
How to upload video?
Well it depends.
If you are using a thick client (aka swing or swt) then you can use Apache Commons File Uplaod API.
For JSP http://www.roseindia.net/jsp/file_upload/index.shtml
With JSF - (http://balusc.blogspot.com/2008/02/uploading-files-with-jsf.html and http://onjava.com/pub/a/onjava/2005/07/13/jsfupload.html)
With AJAX - http://www.openjs.com/articles/ajax/ajax_file_upload/ (basic example but enough to guide in right direction :))
what concepts i have to learn?
As a library integrator you will need to know about the front end technology you are going to use (JSF, JSP or PHP etc)
You should know about basic of multimedia handling in java (sometimes help in debugging)
Basic of flash video (specially how streaming works in internet video http://blog.xuggle.com/2009/01/23/overly-simplistic-guide-to-internet-video/ )
Assuming you already know about servlets etc.
Have a look at HTML5. It has some great offerings like video playback etc.
what are all the libraries i may
require?
Again depends
IF choosing javascript for front end + AJAX in mind http://jqueryui.com/ or http://jquery.com/
IF JSF is the choice for front end - http://www.jboss.org/richfaces or http://www.primefaces.org/ along with JSTL etc
You will need a library like http://www.xuggle.com/xuggler/
Xuggler is the easy way to uncompress,
modify, and re-compress any media file
(or stream) from Java. Xuggler is
available under the GNU Lesser General
Public License.
Most of the Flash video sites either use xuggler or FFMpeg for conversion and playback.
How to convert it into flash format?
Use Xuggler http://www.xuggle.com/xuggler/. It uses the FFMpeg http://www.ffmpeg.org/. Though you have to use at server side for conversion (As of now you can not use it in applet). Refer to http://wiki.xuggle.com/Tutorials for more information.
How to stream it back to user?
I normally do it in this fasion.
<embed height="385" width="640" type="application/x-shockwave-flash" src="http://s.ytimg.com/yt/swf/watch_as3-vflofTU0v.swf" id="movie_player" flashvars="rv.7.length_seconds=107&rv.2.thumbnailUrl=http%3A%2F%2Fi4....." allowscriptaccess="always" allowfullscreen="true" bgcolor="#000000">
I hope it will help you :)

Categories

Resources