MP3 Encoding in Java

后端 未结 6 1728
后悔当初
后悔当初 2020-12-06 06:43

I need an OpenSource API in Java, which can encode *.wav and *.au formats to MP3 and vice-versa.

I have evaluated Java Sound API and LameOnJ, but they do not meet m

6条回答
  •  醉话见心
    2020-12-06 07:24

    The Jave2 project is Java library that wraps FFMPEG and provides most of its functionality* through a rather useful Java API.

    Pros:

    • Useful Java API that is powerful and rather simple.
    • FFMPEG binary is bundled in, so you don't have to manage an FFMPEG installation on your system.

    Cons:

    • Does not support streaming data: you have to work through temporary files: every conversion starts by storing all the content in some files on the system, getting FFMPEG to create new files for you, then reading them. This is not a deficiency in FFMPEG, more of a problem in Java where it is very hard to stream data to external processes**.

    *) specifically around format conversion - the filter functionality is mostly not represented.

    **) In Java, launching a process and connecting to its standard output and input is possible but not comfortable, and using named pipes (the BKM for piping AV to/from FFMPEG) is almost impossible, and even if you do manage to do that, Jave2 doesn't play well with that. I have a set of tools to workaround these problems, based on JNA, if anyone is intersted - I can share.

提交回复
热议问题