One: ffmpeg official website: FFmpeg official website
Two: install ffmpeg under windows
1: Download ffmpeg

Download address of ffmpeg under windows: https://www.gyan.dev/ffmpeg/builds/

Choose the appropriate ffmpeg to download, here I choose ffmpeg-2021-12-02-git-4a6aece703-full_build.7z
image.png
2: Configure environment variables

Unzip the downloaded ffmpeg, right click on My Computer-"Properties-"Advanced System Settings-"Environment Variables -" System Variables, configure ffmpeg environment variables in Path, the address is the bin directory of the ffmpeg directory

For example: D:\ffmpeg\bin

3: Determine whether ffmpeg is installed

ffmpeg -version
The following indicates that the installation was successful
image.png
Three: install ffmpeg under linux
1: Install dependent packages
(1): Install SDL2

View the matching version of the system:
yum search SDL2
image.png
Install the SDL2 development library:
yum install SDL2-devel.x86_64
(2): Install yasm
yasm download address: yasm download address

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
yasm --version

Install yasm as above
(3): Install x264
x264 download address: x264 download address

git clone https://code.videolan.org/videolan/x264.git
cd x264
./configure --prefix=/usr/local/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared --disable-asm
make && make install

Install x264 as above

2: Install ffmpeg
ffmpeg download address: ffmpeg download address

(1): Download and install ffmpeg

wget http://www.ffmpeg.org/releases/ffmpeg-4.4.1.tar.gz
tar -zxvf ffmpeg-4.4.1.tar.gz
cd ffmpeg-4.4.1/
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-shared --enable-libx264 --enable-libfreetype
make && make install

(2): Configure environment variables
vim /etc/profile
Add the following information in the profile file

export FFMPEG_PATH=/usr/local/ffmpeg
export CLASSPATH=$FFMPEG_PATH/lib:$CLASSPATH
PATH=$FFMPEG_PATH/bin:$PATH

Reload environment variables
source /etc/profile
(3): Configure ffmpeg startup directory
vim /etc/ld.so.conf
Add the following information in the ld.so.conf file
/usr/local/ffmpeg/lib
Reload configuration
ldconfig
According to the above arrangement, ffmpeg can be installed under linux
ffmpeg -version
image.png
ffmpeg installed successfully


huaweichenai
635 声望114 粉丝