Use FFmpeg to turn AMR into MP3 under Linux

Source: Internet
Author: User

Not named

Received the need to convert AMR to mp3,windows under the Linux environment directly using the third party jar package Package EXE method can be, but does not support Linux, the internet climbed the data said to be using FFmpeg plus AMR plug-in can be achieved, according to the tutorial to try a bit:

1. Install the system compilation environment first

Yum install-y automake autoconf libtool gcc gcc-c++ #CentOS

2. Compile the required source code package

#yasm: Assembler, new version of FFmpeg added assembly code wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gztar - Xzvf yasm-1.3.0.tar.gzcd yasm-1.3.0./configuremakemake install#lame:mp3 Audio decoding wget http:// Jaist.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gztar -xzvf lame-3.99.5.tar.gzcd  LAME-3.99.5./CONFIGUREMAKEMAKE INSTALL#AMR Support wget http://downloads.sourceforge.net/project/ opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gztar -xzvf opencore-amr-0.1.3.tar.gzcd  OPENCORE-AMR-0.1.3./CONFIGUREMAKEMAKE INSTALL#AMRNB Support wget http://www.penguin.cz/~utx/ftp/amr/ Amrnb-11.0.0.0.tar.bz2tar -xjvf amrnb-11.0.0.0.tar.bz2cd amrnb-11.0.0.0./configuremakemake  INSTALL#AMRWB Support wget http://www.penguin.cz/~utx/ftp/amr/amrwb-11.0.0.0.tar.bz2tar -xjvf  amrwb-11.0.0.0.tar.bz2cd amrwb-11.0.0.0./configuremakemake install#ffmpegwget http://ffmpeg.org /releases/ffmpeg-2.5.3.tar.bz2tar -xjvf ffmpeg-2.5.3.tar.bz2cd ffmpeg-2.5.3./configure --enable-libmp3lame -- Enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-sharedmakemake  install# load configuration # After the last write to config, the terminal runs the FFmpeg command, the success and installed extensions appear, and the run succeeds. Ldconfig


3. How to use

Ffmpeg-i 1.mp3-ac 1-ar 8000 1.amr #MP3转换AMRffmpeg-i 1.amr 1.mp3 #AMR转换MP3


Appendix:
Appendix 1. FFmpeg default installation directory is "/usr/local/lib", some 64-bit systems under the software directory is "/usr/lib64", the compilation process may appear
"Ffmpeg:error while loading shared libraries:libmp3lame.so.0:cannot open Shared object file:no such file or directory" The solution to such a similar error is to establish a soft link:
# ln-s/usr/local/lib/libmp3lame.so.0.0.0/usr/lib64/libmp3lame.so.0

Appendix 2. If the following prompt appears: Ffmpeg:error while loading shared libraries:libavdevice.so.54:cannot open Shared object file:no such file or The directory
can view ffmpeg's dynamic link library in the following ways:

ldd  ' Which ffmpeg '         libavdevice.so.54 =>  Not found        libavfilter.so.3 => not found         libavformat.so.54 => not found         libavcodec.so.54 => not found         libswresample.so.0 => not found         libswscale.so.2 => not found         libavutil.so.51 => not found        libm.so.6 = > /lib64/libm.so.6  (0x00002ab7c0eb6000)          libpthread.so.0 => /lib64/libpthread.so.0  (0x00002ab7c100b000)          libc.so.6 => /lib64/libc.so.6  (0x00002ab7c1125000)         /lib64/ ld-linux-x86-64.so.2  (0x00002ab7c0d9a000) #如果类似于上面的输出内容, find the above class library, you will find all under/usr/local/lib/find /usr/local/ lib/ | grep -e  "libavdevice.so.54|libavfilter.so.3|libavcodec.so.54"/usr/local/lib/ libavfilter.so.3.17.100/usr/local/lib/libavcodec.so.54.59.100/usr/local/lib/libavdevice.so.54/usr/local/lib/ libavcodec.so.54/usr/local/lib/libavfilter.so.3/usr/local/lib/libavdevice.so.54.2.101  #查看链接库配置文件more   /etc/ld.so.conf | grep /usr/local/lib# if not included, you need to edit this article to add: vi /etc/ld.so.conf/usr/ local/lib/usr/local/lib64# Run Configuration Command ldconfig

About FFmpeg Introduction:

FFmpeg is an open source, free cross-platform video and audio streaming solution that belongs to free software, with a LGPL or GPL license (depending on the component you choose). It provides a complete solution for recording, converting, and streaming audio and video. It contains a very advanced audio/video codec library Libavcodec, in order to ensure high portability and codec quality, Libavcodec Many codec are developed from scratch. Its official website is: http://www.ffmpeg.org

Finally, some of the contents refer to Http://linux.it.net.cn/e/Linuxit/2014/0828/3980.html


Use FFmpeg to turn AMR into MP3 under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.