I want to build a community website with videoconferencing functionality integrated. I would prefer to provide this from within the browser, so I'm looking for a Java- or Flash-based solution.
Also, it would be nice to spare bandwidth by having the clients stream their audio and video data without using a central server (like the way Skype works, for example).
Is there a reasonably mature open-source project that meets these criteria?
When doing Voice over IP, UDP is preferred, and web browser plugins usually lacks support for UDP and P2P-connections.
But there is a solution. You have to use Adobe Flash Player 10 and the Adobe Stratus for this. This is actually what Chatroulette is using for P2P streamed video chat.
Take it from someone who found out the hard way: Java's support for video playback is pisspoor. They keep promising a new, fantastic video playback system, but meanwhile we are STILL stuck with Java Media Framework, the platform-limited, MPEG-4 incompatible mess.
Your alternatives are Quicktime for Java and systems wrapping MPlayer/VLC/etc. None of those are really options for a browser.
Much as I hate Adobe and the evils of Flash site design, Flash is far and away your best option.
See the Xuggler library -- it includes code for playing back video (well, sample code) in the com.xuggle.mediatool.IMediaVieer object.
Related
I want to get some advice. I have to implement java server which will stream video from user to other clients. On client side will be using WebRTC. Can you give me some ideas how to implement this? Thank you)
You should use a media server that has WebRTC capabilities to do that. Don't try to write one on your own.
Here are a few open source alternatives: Janus, Jitsi, Kurento, mediasoup
If you plan on using an open source one, then I suggest you also understand the realities of these options - some got acquired, which changed a bit how they operate and how solid a solution they may be for you: https://bloggeek.me/twilio-acquires-kurento/
Janus video room demo is doing that. Although Janus is not written in Java, and I would say it is less than rock solid, it works quite well for this purpose.
We could not make Kurento working (last year). It seemed having odd requirements of a specific Linux distribution and version, and even once it was working fine, it just stopped working for no reason a month after.
Kurento does offer a lot more than Janus, OTOH you don't need those features. Using simple WebRTC and Janus makes this use case possible.
There is no need to write any Java server. Clients can send the video stream right from a HTML5 webpage, and viewers can view it right in HTML5. Janus examples show the actual code.
I have a plan to develop RTSP streaming server with java. Now I have to decide with library used to decode media and stream data in rtp format. I am looking into vlcj and xuggler for video decoding and streaming. I did some research about differences of these library but I cannot make a decision yet. So I would like to ask you guys if I want to build a server which provide following feature. Do you think which one is better?
1. can stream video on demand to multiple users
2. can receive stream in mms format and restream it to rtsp format
Initially, I try ffmpeg and ffserver but there is audio out of sync problem so I decide to make my own server. the good way to use vlcj is to use out-of-process but I am afraid about performance in video on demand. I think about xuggler but I am afraid that it will have the same problem as I have in ffmpeg.
Could you throw me your opinion which one is appropriate on this situation?
With VLCJ (or Xuggler) depend that the machine has run the necessary libraries installed. Also, personally, I could not do a pilot with VLCJ Streaming server (and I've tried for a long time).
Java SE provides a framework called JMF (Java Media Framework) for developing, among other things, a streaming server
http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html
This framework is not the best there is, but it's work.
As a final note, I can say that I have developed a streaming server in Java with JMF, you can see it here http://code.google.com/p/servidor-streaming-rtp-rstp-java/ to give you a reference.
Regards!
I want to read in a live video stream, like RTSP, run some basic processing on it, and display it on a website. What are some good ways to do this? I have used OpenCV for Python before but found it to be a hassle. I am also familiar with Java and C++ if there are better libraries available. I haven't done a lot of web development before either.
What kind of live video source that you mean? If you don't intend to do this code-wise, you can use the free VLC Player to act as a streaming service in between any kind of media stream source (file, network, capture device, disc) and your web video client.
But, if you intend to do this code-wise, you can you VLCJ library. Other options can be Xuggler or FMJ.
I need to stream multiple videos in a web browser and have them all be synchronized; I also need to be able to switch between audio channels on the fly. Despite a lot of research, it looks as though at present this is impossible using the current browser implementations of HTML5 video. Flash seems to have the same problem. There are forums full of people wanting to do on-the-fly, in-band audio and video switching with sync, and multi-video playback with sync, but no real way to do it.
It's in the HTML5 spec for the future, actually, but has no browser implementation yet.
So, I need to build a custom plugin or application.
What is the best approach to doing this? Would something like Google Web Toolkit be a good place to start? Is client-side Java a good approach to building something this custom but with ease of deployability (vs say OS-specific C++ plugins, for example)?
JavaFX 2(An official supported Java library) has a video player which I've seen modified interesting in a 3d world and basically doing what you want. Currently it only supports flv, but they probably change it like it was in JavaFX 1 and support what ever installed codecs on ones computer, once out of beta.
Edit: Checking over the video stuff again not totally sure on keeping things in sync when this is on there roadmap (http://javafx.com/roadmap/)
Synchronized Media and Animations
Sometimes applications need to have very tightly aligned media and
animation in a timeline. JavaFX 2.0 will provide support to tie a
timeline to a specific media stream such that events in the timeline
occur in sync with events in the media stream.
How can I get video and audio streams from web cameras with Java (in a cross-platform way)?
For example, we have a computer with 3-4 USB web cameras; we want to get their streams and make them visible in the user interface. How can we perform such a thing? I need code for a simple app which would find ALL cameras on the computer and let us select camera to wach. Can any one, please share such one?
With java media framework JMF or FMJ
Here is an example with JVM
I see your comment about the solution needing to be "pure" java, but this is really "nearly" impossible. You will need to use some sort of native library for accessing the devices, with that being stated; I suggest that you look at Xuggler as your solution. Xuggler supports Windows, Mac, and Linux and they also offer example code for handling audio and video. Lastly the library is FREE.
Webcam capture example: http://xuggle.googlecode.com/svn/trunk/java/xuggle-xuggler/src/com/xuggle/xuggler/demos/DisplayWebcamVideo.java
While Xuggle does not have an example of microphone capture, you can find samples on the mailing list or you could use code written by the packet-mulitbroadcaster project found here: https://code.google.com/p/packet-multibroadcaster/
You can try my solution. It uses OpenCV to capture the image and jetty server to transmit it via WebSocket. The example has three classes and it will be easy to understand.
Now I can send only video, but I'm working on audio aswell.
I'd use flex. It can be relatively easily integrated with java backend.
UPD:
Pure Java needed
Then you should consider JavaFX solutions. I'm not a big expert in javafx, I've only written some basic test applications, but I'm sure it's a modern way of solving described problem with pure java.