0

There are some set of questions i wanted to ask related to Java Sound which are as follows :

  • Can i use xuggler with netbeans ?
  • If yes can anyone please tell the way out ?
  • What are the audio and video formats xuggler is able to decode
  • Is xuggler the best open source library to play audio and video in java ?
  • Is JLayer a good library to play audio files ?
  • Can i use JLayer to play video files ?

I want my program to play mp3,wav,mp4,3gp files (commonly used) which is the best library to use ?

Community
  • 1
  • 1
program-o-steve
  • 2,630
  • 15
  • 48
  • 67
  • One question per post - will make discussions on each area easier – Noel M Jul 30 '11 at 18:54
  • @ Noel M i would have posted only the first question..But SO says _does not meet our quality standards !_ if put up a small question so posted all at once :) – program-o-steve Jul 30 '11 at 18:57
  • I can't see any issue with asking "What are the audio and video formats xuggler is able to decode" or "Can i use JLayer to play video files" as one question. Some others seem to be subjective and would probably get closed. As for the first question, Google seems to answer that – Noel M Jul 30 '11 at 18:59
  • @ Noel M it would be nice if you answer it. I didn't find anything. – program-o-steve Jul 30 '11 at 19:01

1 Answers1

2

From the top down:

  • Yes, what have you tried? I just installed Xuggler then added the jars and it worked like any other library would. There's nothing special you need to set it up.
  • As above, you'll have to be more specific over what's wrong. It shouldn't require anything special.
  • It depends, but basically anything ffmpeg supports. For more specific information see here.
  • If you're not doing any encoding / transcoding work and all you're doing is playing videos, I'd personally say no, it's not the best. It works on much too low a level, something like VLCJ would probably be a better option using out of process players to make sure it all works correctly. A bit of effort to set up but once you have it there you shouldn't have any problems stability wise, and it'll support pretty much any format out there.
  • Well, yes, but if you're using something like VLCJ already then that can handle everything like that for you.
  • Unless I'm missing something (correct me someone if I'm wrong on this) no.
Michael Berry
  • 70,193
  • 21
  • 157
  • 216
  • Well to play a video, you have to grab each packet from the container, decide whether it's an audio or video packet, play it at the right time, sync all the streams up, cope with any errors that might show up... and this is before we deal with syncing and suchlike! There's no play(), pause(), stop() etc. methods - it's not an API that works on that conceptual level. – Michael Berry Aug 02 '11 at 17:18
  • @ berry120 I can pause the `DataLine` using `stop()` ! But yes analyzing each packet is too much of a work. – program-o-steve Aug 02 '11 at 17:28
  • 1
    @steve yes, granted! But you see what I mean. As an aside, Xuggler is fantastic for encoding / transcoding work where you need to analyse packets in that sort of detail - it's a very good solution. Just for playback, VLCJ is most likely a better alternative. – Michael Berry Aug 02 '11 at 18:01
  • @ berry120 [Can i forward data using xuggler ?](http://stackoverflow.com/questions/6924474/forwarding-and-rewinding-audio-in-xuggler) – program-o-steve Aug 03 '11 at 09:57