FFmpeg - 2. source compiler installation (Linux)

1. Download

Download the latest source from GitHub above

git clone https://github.com/FFmpeg/FFmpeg.git

2. Installation & Configuration

After completing the download directory into the FFmpeg

carried out

./configure

make

make install

There is no experience configuration, the compiler issues in this version

 

3. Verify

If you encounter problems, you can refer to the following links:

https://www.linuxidc.com/Linux/2018-10/154934.htm

https://www.cnblogs.com/wanghetao/p/3386311.html

https://www.cnblogs.com/freeweb/p/6897907.html

https://www.linuxidc.com/Linux/2019-03/157443.htm

https://www.cnblogs.com/CoderTian/p/6655568.html

4. Error might encounter

Unknown encoder 'libx264'

That is, the lack of libx264 library, you need to install the library:

1. git clone http://git.videolan.org/git/x264.git

2. cd x264

3. ./configure --enable-static --enable-shared

4. make

5. sudo make install

 

You need to be recompiled to install ffmpeg

1. Configuration ffmpeg, plus x264, such as:

./configure --enable-gpl --enable-libx264

2. make clean - this step can be omitted

3. make 

4. make install

验证:ffmpeg -i input.mp4 -c:v libx264 -c:a copy -f mpegts output.ts

Error:

ffmpeg: error while loading shared libraries: libx264.so.159: cannot open shared object file: No such file or directory

Modify the file ld.so.conf

1. $ south you /etc/ld.so.conf

2. Modify the following

/usr/local/lib
include ld.so.conf.d/*.conf

/ Usr / local / lib is the library path x264

3. bring it into force

$ sudo ldconfig

Execute the following command:

ffmpeg -i input.mp4 -c:v libx264 -c:a copy -f mpegts output.ts

success! ! !

 

Published 47 original articles · won praise 121 · views 680 000 +

Guess you like

Origin blog.csdn.net/guoyunfei123/article/details/105217532