FFmpeg Installation for Ubuntu

简介:

Install FFmpeg on Ubuntu

Actually it is very easy to install FFmpeg under Ubuntu with the apt-get command. Unfortunately, the default FFmpeg installation doesn't let you include the latest codecs which are needed by Razuna. Thus you have to compile FFmpeg yourself. Just follow the steps below. It is very easy!


Install the Dependencies

Uninstall x264, libx264-dev, and ffmpeg if they are already installed.


Next, get all of the packages you will need to install FFmpeg and x264 (you may need to enable the universe and multiverse repositories):

sudo apt-get update

Ubuntu 10.04 LTS


sudo apt-get install build-essential subversion git-core checkinstall texi2html \

libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \

libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev libavcodec-dev

Ubuntu 9.10


sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html \

libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev \

libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev libavcodec-unstripped-52

Install x264

Get the most current source files, compile, and install. You can run "./configure --help" to see what additional features you can enable/disable.


Ubuntu 10.04 LTS


cd

git clone git://git.videolan.org/x264.git

cd x264

./configure --enable-static--disable-opencl

make

sudo checkinstall --pkgname=x264 --default--pkgversion="3:$(./version.sh | \

awk -F'[" ]''/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes

Ubuntu 9.10


cd

git clone git://git.videolan.org/x264.git

cd x264

./configure

make

sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`+`git rev-list HEAD -n 1 | head -c 7`"--backup=no --default

Troubleshooting


If the configure complains about nasm requiring version 1.x, then you need to download and build yasm with the latest build. Follow these intsructions to do so (each line is a command!):


sudo apt-get install build-essential checkinstall

sudo apt-get build-dep yasm

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz && \

tar -xf yasm-1.2.0.tar.gz && cd yasm-1.2.0&& ./configure

make

sudo checkinstall --pakdir "$HOME/Desktop"--pkgname yasm --pkgversion 1.2.0\

--backup=no --default

Now try to configure X264 again.


Install libvpx

This is used to encode and decode VP8 video (WebM).


cd

git clone http://git.chromium.org/webm/libvpx.git

cd libvpx

./configure

make

sudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%H%M`-git"--backup=no \

--default--deldoc=yes

Install lame

Used for MP3.


sudo apt-get remove libmp3lame-dev

sudo apt-get install nasm

cd

wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz

tar xzvf lame-3.98.4.tar.gz

cd lame-3.98.4

./configure --enable-nasm --disable-shared

make

sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4"--backup=no --default--deldoc=yes

Install libtheora (only needed on Ubuntu 9.10)

This is used to encode to Theora, the video type usually found in OGG/OGV files. The repository libtheora is too old, so it must be compiled.


sudo apt-get install libogg-dev

cd

wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz

tar xzvf libtheora-1.1.1.tar.gz

cd libtheora-1.1.1

./configure --disable-shared

make

sudo checkinstall --pkgname=libtheora --pkgversion "1.1.1"--backup=no --default

Install FFMpeg

Get the most current source files from the official FFmpeg SVN, compile, and install.


Ubuntu 10.04 LTS


cd

git clone git://source.ffmpeg.org/ffmpeg.git

cd ffmpeg

git checkout release/2.0

./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \

--enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb \

--enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid \

--enable-x11grab --enable-libvpx --enable-libmp3lame

make

sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)"--backup=no \

--deldoc=yes --default

hash x264 ffmpeg ffplay ffprobe

Ubuntu 9.10


cd

git clone git://source.ffmpeg.org/ffmpeg.git

cd ffmpeg

git checkout release/2.0

./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 --enable-x11grab

make

sudo checkinstall --pkgname=ffmpeg --pkgversion "4:0.5+svn`date +%Y%m%d`"--backup=no --default

hash x264 ffmpeg ffplay

Updating FFmpeg and x264

Development of FFmpeg and x264 is active and an occasional update can give you new features and bug fixes. To update FFmpeg and x264 you will need to remove the packages, make distclean, update the source, recompile, and install.


To update x264:


sudo apt-get remove ffmpeg x264 libx264-dev libvpx

cd ~/x264

make distclean

git pull

Now compile x264 as shown earlier in the guide starting with the x264 ./configure line. You can update libvpx if you installed that too:


cd ~/libvpx

make clean

git pull

Now continue with the installation starting with the libvpx ./configure line. Now update FFmpeg:


cd ~/ffmpeg

make distclean

git pull

Finish the installation starting with the FFmpeg ./configure line from above.



本文转自 holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/1288477

相关文章
|
7月前
|
Ubuntu
音视频ubuntu安装ffmpeg6.0简略笔记
音视频ubuntu安装ffmpeg6.0简略笔记
176 0
|
2月前
|
并行计算 PyTorch TensorFlow
Ubuntu安装笔记(一):安装显卡驱动、cuda/cudnn、Anaconda、Pytorch、Tensorflow、Opencv、Visdom、FFMPEG、卸载一些不必要的预装软件
这篇文章是关于如何在Ubuntu操作系统上安装显卡驱动、CUDA、CUDNN、Anaconda、PyTorch、TensorFlow、OpenCV、FFMPEG以及卸载不必要的预装软件的详细指南。
4061 3
|
Ubuntu 编译器
Ubuntu18.4下交叉编译X264和FFMPEG到ARM平台(aarch64-linux-gcc)
Ubuntu18.4下交叉编译X264和FFMPEG到ARM平台(aarch64-linux-gcc)
1503 0
|
2月前
|
Ubuntu 应用服务中间件 nginx
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
本文是关于Ubuntu系统中使用ffmpeg 3.2.16源码编译OpenCV 3.4.0的安装笔记,包括安装ffmpeg、编译OpenCV、卸载OpenCV以及常见报错处理。
163 2
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
|
Ubuntu 编译器 芯片
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
|
6月前
|
Ubuntu
蓝易云 - Ubuntu18.04安装编译ffmpeg库
现在,你应该已经在你的Ubuntu 18.04系统上成功安装和编译了FFmpeg库。你可以通过运行 `ffmpeg -version`来验证安装是否成功。
68 0
|
7月前
|
存储 Ubuntu 开发工具
ffmpeg笔记(二)windows下和ubuntu-16.04下ffmpeg编译
ffmpeg笔记(二)windows下和ubuntu-16.04下ffmpeg编译
116 0
|
编解码 Java Linux
linux【redhat&ubuntu】下ffmpeg-3.1安装编译及视频转码
这篇是几年前整理的老文章了,当时在调研流视频推送及播放相关技术,并在项目中应用,使用到ffmpeg,所以整理了这篇文章,但并未发布。最近又有相关的技术需求,所以整理出来,作为一个新的开始。
313 0
|
编解码 Ubuntu IDE
基于Ubuntu交叉编译X264, FFmpeg Windows SDK详细教程
基于Ubuntu交叉编译X264, FFmpeg Windows SDK详细教程
240 0
|
编解码 缓存 NoSQL
用Ubuntu18与clion调试FFmpeg
用Ubuntu18与clion调试FFmpeg
336 0