Ubuntu安装FFmpeg编码出MP4文件的方法
FFmpeg是Ubuntu下强大的视频、音频编解码工具。 x264可以编码出高质量的h.264视频,iPad必须要h.264编码或mpeg-4编码的视频才能正常播放。Ubuntu官方源默认是不提供h.264编码的,这就需要我们手工编译安装FFmpeg的h.264支持,使之能够编码出MP4文件。
AD:2013云计算架构师峰会课程资料下载
?
FFmpeg是Ubuntu下强大的视频、音频编解码工具。 x264可以编码出高质量的h.264视频,iPad必须要h.264编码或mpeg-4编码的视频才能正常播放。
由于版权方面尚未确定,虽然全国很多网站都在使用h.264编码,但将来很有可能会被版权问题所困扰,所以Ubuntu官方源默认是不提供h.264编码的,这就需要我们手工编译安装FFmpeg的h.264支持,使之能够编码出MP4文件。
Ubuntu下安装、使用和升级FFmpeg的方法如下
1、安装支持包
#卸载现有的 x264、libx264-dev、FFmpeg
3、安装FFmpeg
4、安装qt-faststart(可选)
这是个重要的x264再编码工具, 它的作用是使得视频不必等待下载完成即可开始播放。
使用方法:
5、基本安装完成,你可以保留 ~/x264、~/ffmpeg目录以便将来升级时使用。
6、升级 FFmpeg 和 x264
总结:
欲知更多有关Ubuntu安装FFmpeg编码出MP4文件的方法,请点击Ubuntu如何转换mp4与x264和h.264。
?
?
https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide
?
?
Contents?
This guide for supported releases of?Ubuntu,?Debian, and?Linux Mint?will provide a local install of the latest FFmpeg tools and libraries including several external encoding and decoding libraries (codecs). This will not provide a system installation and therefore will not interfere with anything such as repository packages. Recent?static builds?are also available for lazy people or those who are unable to compile.
Copy and paste the whole code box for each step.
x264
H.264 video encoder. See the?x264 Encoding Guide?for more information and examples.
Note:?You can download the nightly??x264 source snapshot?as an alternative to using?git.
fdk-aac
AAC audio encoder. See the?AAC Encoding Guide?for more information and examples.
Note:?You can download a??fdk-aac source snapshot?as an alternative to using?git.
libmp3lame
MP3 audio encoder.
Most users can install the repository package:
libopus
Opus audio decoder and encoder.
Ubuntu 13.10, Ubuntu 13.04, and Mint 15 users can alternatively install the?libopus-dev?package from the repository instead of compiling.
libvpx
VP8/VP9 video encoder and decoder. See the?vpx (WebM) Encoding Guide?for more information and examples.
Ubuntu 13.10, Ubuntu 13.04, and Mint 15 users can alternatively install the?libvpx-dev?package from the repository instead of compiling.
Note:?You can download a??libvpx source snapshot?as an alternative to using?git.
ffmpeg
Note:?Server users should remove?--enable-x11grab?from the following command:
Note:?You can download the nightly?FFmpeg source snapshot?as an alternative to using?git.
Finish
Installation is now complete and ffmpeg is now ready for use. See the?x264 Encoding Guide?for examples.If you do not see?FFmpeg developers?in your ffmpeg console output then something went wrong and you're probably using the??fake "ffmpeg"?from the repository.HTML formatted documentation is available in?~/ffmpeg_build/share/doc/ffmpeg.You can keep the?ffmpeg_sources?directory if you plan on updating later. See?Updating FFmpeg?below for more details followed by instructions for?reverting all changes?made by this guide.
Updating FFmpeg
Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First, remove (or move) the old files and then update the dependencies:
?Howto: Compile the development version of VLC under the latest Ubuntu release?Howto: Build the svn MPlayer under the latest release version of Ubuntu