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

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...