Install ffmpeg in centos to add ogg audio support. For more information, see CentOS.
Brief Introduction
FFmpeg is a free software that can run video, conversion, and stream functions in multiple formats of audio and video [1]. contains libavcodec, a decoder library for audio and video in multiple projects, and libavformat, a library for converting audio and video formats. (From Wikipedia)
Prerequisites
Because the installation package cannot be found when yum install ffmpeg is used in centos, you need to install it in other ways:
1. install ffmpeg
Operating system: centos 5.6
(1) install the compiling environment
Copy codeThe code is as follows:
# Yum install-y automake autoconf libtool gcc-c ++
(2) install the RPM Package of the required Library to centos (because the built-in library of centos does not have the ffmpeg package, it is equivalent to the extension here)
Copy codeThe code is as follows:
# Rpm-Uhv
(3) Install ffmpeg and other modules
Copy codeThe code is as follows:
Yum-y install ffmpeg-devel
Of course, you can also choose to compile the source code for installation. you only need to install the support library required by ffmpeg before installation. the reason why I chose this installation method is that I don't want to compile various libraries one by one.
After installation, run the following command to view the information:
Copy codeThe code is as follows:
./Configure -- prefix =/usr
After the installation, your machine adds ogg audio support. Here you need to install libogg first, because libvorbis requires libogg support.
Recompile ffmpeg
Next, you need to recompile and install ffmpeg. at this time, you need to download the source code package of ffmpeg.
Run
Copy codeThe code is as follows:
Ffmpeg
Copy the following information:
Copy codeThe code is as follows:
Configuration: -- prefix =/usr -- libdir =/usr/lib64 -- shlibdir =/usr/lib64 -- mandir =/usr/share/man -- incdir =/usr/include -- disable-avisynth -- extra-cflags = '-O2-g-pipe-Wall-Wp, -D_FORTIFY_SOURCE = 2-fexceptions-fstack-protector -- param = ssp-buffer-size = 4-m64-mtune = generic-fPIC '-- enable-avfilter -- enable-libdirac -- enable- libfaac -- enable-libfaad -- enable-libfaadbin -- enable-libgsm -- enable-libmp3lame -- enable-libopencore-amrnb -- enable-libopencore-amrwb -- enable-libx264 -- enable-gpl -- enable-nonfree -- enable- postproc -- enable-pthreads -- enable-shared -- enable-swscale -- enable-vdpau -- enable-version3 -- enable-x11grab
Of course, you can remove unnecessary ones,
Run in the ffmpeg Source Code Directory
Copy codeThe code is as follows:
. /Configure -- prefix =/usr -- libdir =/usr/lib64 -- shlibdir =/usr/lib64 -- mandir =/usr/share/man -- incdir =/usr/include -- disable- avisynth -- extra-cflags = '-O2-g-pipe-Wall-Wp, -D_FORTIFY_SOURCE = 2-fexceptions-fstack-protector -- param = ssp-buffer-size = 4-m64-mtune = generic-fPIC '-- enable-avfilter -- enable-libdirac -- enable- libfaac -- enable-libfaad -- enable-libfaadbin -- enable-libgsm -- enable-libmp3lame -- enable-libopencore-amrnb -- enable-libopencore-amrwb -- enable-libx264 -- enable-gpl -- enable-nonfree -- enable- postproc -- enable-pthreads -- enable-shared -- enable-swscale -- enable-vdpau -- enable-version3 -- enable-x11grab -- enable-libvorbis
The last one is-enable-libvorbis, which is added to ogg audio support.
After compilation, run
Copy codeThe code is as follows:
Make & make install
Then install ffmpeg.
Simple test
Run the following command to test the transcoding from amr to ogg:
Copy codeThe code is as follows:
Ffmpeg-I xxx. amr-f ogg-acodec libvorbis-ac 2-AB 128 k-ar 44100 xxx.ogg
Run the following command to test the transcoding from amr to mp3:
Copy codeThe code is as follows:
Ffmpeg-I xxx. amr xxx.mp3
It can be seen that ffmpeg supports mp3 much better.
After transcoding is successful, you can see output similar to the following: