Install ffmpeg in CentOS Linux environment

        This is the method I searched on the Internet. I have personally tested it and it is easy to use. I will write an article and share it with you.

Reminder : The process of installing ffmpeg will be very slow, because it has too many integrated functions, so there is no need to wait for a long time during the installation process. is very slow, such as steps 2 and 5).

        1. Download the ffmpeg toolkit and unzip it

wget http://www.ffmpeg.org/releases/ffmpeg-4.2.tar.gz
tar -zxvf ffmpeg-4.2.tar.gz

        2. Enter the toolkit folder and install it, and install ffmpeg under /usr/local/ffmpeg

cd ffmpeg-4.2

./configure --prefix=/usr/local/ffmpeg
./configure --prefix=/usr/local/ffmpeg --enable-openssl --disable-x86asm
make && make install

Note: If the following error occurs, please skip to the fifth step, and return to the second step after the fifth step is successfully installed.

        3. Configure environment variables to make the ffmpeg command take effect

#利用vi编辑环境变量
vi /etc/profile

#在最后位置处添加环境变量,点击i进入编辑模式,esc键可退出编辑模式
export PATH=$PATH:/usr/local/ffmpeg/bin

#退出编辑模式后,:wq 保存退出
#刷新资源,使其生效
source /etc/profile

         4. Check the ffmpeg version and verify whether the installation is successful

ffmpeg -version

If the following content appears, the installation is successful.

        5. If the error message in the picture appears in the second step, you need to install yasm

 Remember to exit the ffmpeg toolkit folder, cd .. to return to the previous level

#下载yasm工具包
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz

#解压
tar -zxvf yasm-1.3.0.tar.gz

#进入工具包文件夹并开始安装
cd yasm-1.3.0
./configure
make && make install

After the installation is complete, return to the second step directly, and the command will not report an error at this time.

The above is the content of this sharing, I hope it will be helpful to you o(* ̄▽ ̄*)ブ

Guess you like

Origin blog.csdn.net/guo0208/article/details/128407572