微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐