首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Ubuntu安装FFmpeg编码出MP4文件的步骤

2013-12-05 
Ubuntu安装FFmpeg编码出MP4文件的方法http://wiki.ubuntu.org.cn/UbuntuSkillsUbuntu安装FFmpeg编码出MP4

Ubuntu安装FFmpeg编码出MP4文件的方法

http://wiki.ubuntu.org.cn/UbuntuSkills

Ubuntu安装FFmpeg编码出MP4文件的方法2011-09-06 16:42 佚名 linux公社?字号:T?|?TUbuntu安装FFmpeg编码出MP4文件的步骤

FFmpeg是Ubuntu下强大的视频、音频编解码工具。 x264可以编码出高质量的h.264视频,iPad必须要h.264编码或mpeg-4编码的视频才能正常播放。Ubuntu官方源默认是不提供h.264编码的,这就需要我们手工编译安装FFmpeg的h.264支持,使之能够编码出MP4文件。

AD:2013云计算架构师峰会课程资料下载

?

FFmpegUbuntu下强大的视频、音频编解码工具。 x264可以编码出高质量的h.264视频,iPad必须要h.264编码或mpeg-4编码的视频才能正常播放。

由于版权方面尚未确定,虽然全国很多网站都在使用h.264编码,但将来很有可能会被版权问题所困扰,所以Ubuntu官方源默认是不提供h.264编码的,这就需要我们手工编译安装FFmpeg的h.264支持,使之能够编码出MP4文件。

Ubuntu下安装、使用和升级FFmpeg的方法如下

1、安装支持包

  1. --pkgname=lame-ffmpeg?--pkgversion="3.98.4"?--backup=no?--default?--deldoc=yes?

#卸载现有的 x264、libx264-dev、FFmpeg

  1. --pkgname=x264?--pkgversion?"2:0.`grep?X264_BUILD?x264.h?-m1?|?cut?-d'?'?-f3`.`git?rev-list?HEAD?|?wc?-l`+git`git?rev-list?HEAD?-n?1?|?head?-c?7`"?--backup=no?--deldoc=yes?--fstrans=no?--default?

3、安装FFmpeg

  1. cd ?
  2. ?
  3. svn?checkout?svn://svn.ffmpeg.org/ffmpeg/trunk?ffmpeg ?
  4. ?
  5. cd?ffmpeg ?
  6. ?
  7. ./configure?--enable-gpl?--enable-version3?--enable-nonfree?--enable-postproc?--enable-libfaac?--enable-libmp3lame?--enable-libopencore-amrnb?--enable-libopencore-amrwb?--enable-libtheora?--enable-libvorbis?--enable-libvpx?--enable-libx264?--enable-libxvid?
  8. #--enable-x11grab ?
  9. ?
  10. gcc使用正确的版本http://forums.debian.net/viewtopic.php?f=10&t=103908http://www.linuxquestions.org/questions/linux-software-2/managed-environment-ffmpeg-install-4175461262/
  11. make ?
  12. ?
  13. sudo?checkinstall?--pkgname=ffmpeg?--pkgversion?"4:SVN-r`LANG=C?svn?info?|?grep?Revision?|?awk?'{?print?$NF?}'`"?--backup=no?--deldoc=yes?--fstrans=no?--default ?
  14. ?
  15. hash?x264?ffmpeg?ffplay?

4、安装qt-faststart(可选)

这是个重要的x264再编码工具, 它的作用是使得视频不必等待下载完成即可开始播放。

使用方法:

  1. --pkgname=qt-faststart?--pkgversion?"4:SVN-r`LANG=C?svn?info?|?grep?Revision?|?awk?'{?print?$NF?}'`"?--backup=no?--deldoc=yes?--fstrans=no?--default?install?-D?-m755?tools/qt-faststart?/usr/local/bin/qt-faststart?

5、基本安装完成,你可以保留 ~/x264、~/ffmpeg目录以便将来升级时使用。

6、升级 FFmpeg 和 x264

  1. --pkgname=ffmpeg?--pkgversion?"4:SVN-r`LANG=C?svn?info?|?grep?Revision?|?awk?'{?print?$NF?}'`"?--backup=no?--deldoc=yes?--fstrans=no?--default ??
  2. scale=640:-1?-threads?0?output.MP4?

总结:

欲知更多有关Ubuntu安装FFmpeg编码出MP4文件的方法,请点击Ubuntu如何转换mp4与x264和h.264。

?

?

https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide

?

Compile FFmpeg on Ubuntu, Debian, or Mint

?

Contents
  1. Get the Dependencies
  2. Compilation & Installation
  3. Finish
  4. Updating FFmpeg
  5. Reverting Changes Made by This Guide
  6. If You Need Help
  7. Also See

?

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.


Get the Dependencies

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 

热点排行