I am looking for a minimal way to convert mp4 file to mp3 file programmatically with Java. Ideally, I also need to cut the target file.Do Java libraries support these or only 3 party ones? How jmf, ffmpeg?
Thanks!
The easiest way is to use ffmpeg via ProcessBuilder with this command
ffmpeg -i input.mp4 -vn -s 00:00:10 -acodec libmp3lame output.mp3
This means: reading mp4 file, ignoring video, output 10 seconds in mp3 format
JAVE is very easy to convert the media file to another format. http://www.sauronsoftware.it/projects/jave/manual.php
I assume that you are going to cut the audio from your mp4 file and save it as mp3. I did not try to do anything with sound encodings, but I pretty well used Xuggler ( http://www.xuggle.com/xuggler/ ) as a library for accessing videos and their documentation to support audio.
Source: https://habr.com/ru/post/1312682/More articles:How to set font Bold, Italic and Underlined in Qt? - textSeveral conditions with CASE statements - sqlHelp with dynamic wind and call / cc - continuationsC #: String split returns a list of strings AND a list of delimiters? - stringRendering an SVG font in Adobe Illustrator or Corel Draw - fontsHow to add an element to the beginning of a dynamic list - javascriptHow to filter objects by their parents on the ManyToOne side in Google App Engine - javaUsage and result of using the shell IE Delphi Shell - shellDelete on a very deep tree - c ++How to print trees on the console? - consoleAll Articles