compile and install ffmpeg on Ubuntu

compile and install ffmpeg on Ubuntu

there are three steps in build ffmpeg
configuration (with a configure script)
compilation (with make)
installation (with make install)

1. configuration
./configure --prefix=$HOME/ffmpeg_build  # run it under ffmpeg top directory
but a error occured during this configuration. it said yasm not installed. so to install it.

about yasm:
An assembler for x86 optimizations used by x264 and FFmpeg. Highly recommended or your resulting build may be very slow.
If your repository offers a yasm package ≥ 1.2.0 then you can install that instead of compiling

the yasm package in my repository is less than 1.2.0, so i did source code installation
cd /work/ffmpeg/ffmpeg-3.2.2
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
make distclean
notice:
a. --bindir="$HOME/bin is the directory yasm to be installed to
b. you should add $HOME/bin to $PATH otherwise the same error will continue to occur in configuration step.
after yasm installed, execute ffmpeg configuration again. and it succeeded.

2. make
run make under ffmpeg home directory

3. install
make install

after step 3, the ffmpeg build is finished. the build results are:
$HOME/ffmpeg_build/lib:          all ffmpeg libs such as libavcodec.a and libavformat.a
$HOME/ffmpeg_build/include   ffmpeg header files(APIs)
$HOME/ffmpeg_build/bin          ffmpeg executable programs, namely ffmpeg, ffplayer and ffserver
in order to run ffmpeg program in any directory, we can add $HOME/ffmpeg_build/bin to $PATH(and export $PATH)

references
1. Compile FFmpeg on Ubuntu, Debian, or Mint
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
2. wiki: Compilation Guide Generic
https://trac.ffmpeg.org/wiki/CompilationGuide/Generic#Whytocompilefromsource







评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值