There will be a problem when converting jave.jar amr format audio to mp3 format and deploying Linux. The converted MP3 file is 0k

Jave encapsulates a layer of calls to external ffmpeg. The reason why it can be converted on windows is: ffmpeg.exe is no problem. The failure of conversion on Linux is also because the possible version of ffmpeg is too old or the dependent library is missing.

ffmpeg for linux requires GLIBC_2.18

ldd --version # query glibc version

 Install glibc version 2.18

 curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz 
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix =/usr
make -j2 # This step will take a long time
make install

 If it still doesn’t work, go to the ffmpeg official website to download the linux installation package, copy the downloaded ffmpeg to the server, and try to convert it manually

Or take out the ffmpeg  file in the jar package and try to convert it manually

First add an execution permission to ffmpeg

chmod +x ffmpeg

Then call ffmpeg to perform the conversion

 ./ffmpeg  -i test.amr  test.mp3

 If the command conversion is successful, but the conversion fails in the jar package importer

It may be the cache. You have a temp directory under Tomcat, enter the jave directory, it is quite multi-layered, go in and see if there is a ffmpeg file, and delete it.

Guess you like

Origin blog.csdn.net/qq_36538368/article/details/125533667