views:

6066

answers:

5

Are there any good libraries for streaming live video using Java? Ideally both ends of the pipe should be written in Java but I am mostly concerned about the video player. What software would you recommend?

UPDATE: It seems that VLC introduces a 1-2 second delay. I need video streaming that is truly live. The record-to-playback delay must be under 300ms.

A: 

This is not exactly what you want but PS3 Media Server is an Upnp & dlna media server coded in Java. You might want to check it. The encoding/decoding parts are native, but the server code is Java.

Cagdas Altinkaya
Looks like a media server but I see no obvious way to do live video streaming.
Gili
+1  A: 

You could always check out JMF (Java Media Framework). It is pretty old and abandoned, but it works and I've used it for apps before. Looks like it handles what you're asking for.

thedude19
+1  A: 

Hi not an expert in streaming but my understanding is that it is included in th Java Media Framework JMF http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/support-rtsp.html

4NDR01D3
+1  A: 

The best video playback/encoding library I have ever seen is ffmpeg. It plays everything you throw at it. (It is used by MPlayer.) It is written in C but I found some Java wrappers.

  • FFMPEG-Java: A Java wrapper around ffmpeg using JNA.
  • jffmpeg: This one integrates to JMF.
stribika
I ended up using VideoLAN (aka VLC Media Player) because it is a superset of ffmpeg. Thank you for the head's up :)
Gili
Ugh. VLC 1.01 isn't suitable for live video streaming. It introduces a 1-2 second delay, even when streaming to the local computer.
Gili
I ended up using VideoLAN (VLC Media Player) in the end in spite of the 1-2 second delay. It seems to be the only game in town right now.
Gili
+1  A: 

You can do this today in Java with the Red5 media server from Flash. If you want to also decode and encode video in Java, you can use the Xuggler project.

Xuggle