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.
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
# 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)
# Rpm-Uhv http://apt.sw.be/RedHat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
(3) Install ffmpeg and other modules
Yum-y install ffmpeg-devel
I have successfully installed it using the above method.
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:
Ffmpeg
Ffmpeg-codecs/* view supported decoding libraries */
Install ogg audio support
The ogg format is mainly used for html5 audio formats. Its files are much smaller than mp3 and wav formats. Of course, they are not comparable to amr's voice formats. Unfortunately, html5 does not support playing amr.
First you need to download the ogg installation package http://xiph.org/downloads/ you need to download the libogg-1.3.1.tar.gz and libvorbis-1.3.3.tar.gz, after the download is completed decompress, both packages can be installed using the following command, enter the extract directory, execute the following command.
./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 re-compile and install ffmpeg. At this time, you need to download an ffmpeg source code package. here you need to download version 0.6.7. If version 2.1.1 is used, some compilation options may not be supported and need to be removed one by one.
Run
Ffmpeg
Copy the following information:
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
. /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
Make & make install
Then install ffmpeg.
Simple Test
Run the following command to test the transcoding from amr to ogg:
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:
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:
For specific transcoding parameters, see help.
FFmpeg details: click here
FFmpeg: click here
Recommended reading:
Compile FFmpeg in Linux to download and compile the source file
Linux compiling and upgrading FFmpeg
Install FFMPEG on CentOS 5.6