Download:

      http://ffmpeg.org/download.html
     
Copy the code

Compile :(see./configure –help for more parameters) : finally compile under /usr/local/ffmpeg

CD ffmpeg # Optional --disable-static: disables the static library --enable-shared: opens the dynamic library; The default configuration is to generate the static link library so. Add this configuration to generate the dynamic library. /configure --prefix=/usr/local/ffmpeg --enable-debug=3 --disable-static --enable-shared make -j 4 make installCopy the code

The –prefix argument specifies the path to compile the output –enable-debug=3 means to enable debugging

Error during compilation: gcc is unable to create an executable file. If gcc is a cross-compiler, use the –enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed.

// sudo apt-get install GCCCopy the code

nasm/yasm not found or too old. Use –disable-x86asm for a crippled build.

If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the [email protected] mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file “ffbuild/config.log” produced by configure as this will help solve the problem.

// YASM is an assembly compiler. Ffmpeg uses assembly instructions such as MMX and SSE for efficiency. Yasm sudo apt install yasm is not installed in the systemCopy the code

The lack of the make:

sudo apt install make
Copy the code

Kdir: cannot create directory ‘/usr/local/ffmpeg’ : Permission denied make: *** [ffbuild/library.mak:102: install-libavdevice-shared] Error 1

No permission:

Sudo passwd # Enter the password and repeat the password su # Enter the password to switch to root, and then make installCopy the code

Configuring Environment Variables

Use vim to open the. Profile file in the home or etc directory to configure the environment:

export PATH=$PATH:/usr/local/ffmpeg/bin
Copy the code

Configuration pkg_config_path:

export PKG_CONFIG_PATH=/usr/local/ffmpeg/lib/pkgconfig
Copy the code

Profile configuration takes effect after the configuration is complete. For details, run echo $PATH to check whether the configuration takes effect. The same is true for PKG.

/usr/local/ffmpeg /usr/local/ffmpeg /usr/local/ffmpeg

bin include lib share
Copy the code

The bin directory contains ffmpeg supported commands,include contains header files, lib contains generated dynamic/static libraries, and share contains documentation information

Did not compile ffplay processing:

It is possible that there is no FFplay in bin after the installation. It is likely that sdL2 is not configured in the system.

Sudo apt-get install libsdl2-2.0 sudo apt-get install libsdl2-devCopy the code

After the installation is complete, go back to configure, make and install

Enter ffmpeg to see the configured information, if the error occurs:

ffmpeg:error while loading shared libraries:libavdevice.so.59:cannot shared object file: No such file or directory
Copy the code

Vi /etc/ld.so.conf: ffmpeg (lib);

usr/local/ffmpeg/lib
Copy the code

After the configuration is complete, run ldconfig to make the configuration take effect