I am planning to implement Video/Audio chat application in Java and I would like to ask you what do you suggest to use. We are currently trying VLCj library, which is great but it seems that VLC does not support streaming of video/audio in real time. Latency is quite high (approx. 1s). I am not sure where the delay comes from (must be something about encoding video),开发者_StackOverflow but so high delay is not very convenient for chat. Although VLC is great application, I cannot find sollution to overcome this problem. So if anyone have any suggestion what to use, or how to configure VLC to make latency lower i would be very grateful. Thanks.
I'd advise against JMF (Java media framework) personally. It's old and pretty unmaintained / dead - Google around and you'll see that it's not just me that advises steering clear!
I've never used VLCj for live video streaming in this way, but if you want to continue down this route you might want to see how it's streaming the video. If it's done over something with error correction it may favour delaying all the frames to request repeats for corrupt ones etc. to give perfect playback. In reality for streaming you want instantaneous playback and if a frame or 2 every so often gets dropped, you can live with it. I'm not quite sure how you'd set that option in VLCj but it's something to look into.
Apart from that you might want to give Xuggler a try - it works on a much lower level than VLCj but this should give you much more control over what's happening (and unlike JMF it's a good, actively maintained project.)
Have you had a look at the Java Media Framework? You will probably need to write ore code than VLCj, but it will be more under your own control.
Also, regarding VLCj, there are a lot of options that you can fiddle to have the results you want. For example, if you are using settings for high compression, depending on the compression used you might have enabled some picture types that delay decoding.
精彩评论