Under linux environment to build ffmpeg record

Installation under yasm 1.Linux

Official website to download: http: //yasm.tortall.net/Download.html 

 tar -zvxf yasm-1.3.0.tar.gz

cd yasm-1.3.0/

./configure

make && make install

 

Under install ffmpeg 2.Linux

Download the official website: http://ffmpeg.org/download.html

takes -zxvf ffmpeg-3.1.3.tar.gz

cd ffmpeg-3.1.3/

./configure --enable-shared --prefix=/usr/local/ffmpeg

make && make install

 

After installation into the installation directory

cd /usr/local/ffmpeg

The main program is a ffmpeg binary bin directory
include a C / C ++ header files directory
lib directory is compiled libraries
share a document directory

Check the version

./bin/ffmpeg -version

报错:error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory

The reason: lib directory is not loaded into the system to link library

Ld /etc/ld.so.conf system directory listing in which all of the following references /etc/ld.so.conf.d/ .conf file

Create a file and write the path to the lib, execute the command: vim /etc/ld.so.conf.d/ffmpeg.conf
 then add a line: / usr / local / ffmpeg /  lib
to save and exit after, then execute ldconfig validate the configuration

 

ffmpeg library is mainly related to the following seven

libavutil: for multimedia programming, mainly comprising a suitable safe string manipulation functions, math functions, producing a random number, a data structure, the multimedia processing related functions (e.g., the pixel count and the sample format) and the like, but it is not libavcodec and libavformat required library code;

libavcodec, libavformat: Some video file formats (such as AVI) does not indicate what kind of coding (such as h.264) should be used to resolve audio and video data, they are just as a video package format audio and video data, so often encountered only open the video file can hear without video, with the video file and to parse libavformat coded stream is separated, the libavcodec decoding the stream;

libavdevice: provide some common multimedia input or output devices gripping a common architecture and rendering, and many input and output devices, such as Video4Linux2, VfW, DShow, and ALSA;

libavfilter: provides a common framework provision of audio and video filters, including some filters, sources, sinks (what is the source, sink, and I did not understand, to be studied)

libswscale: performing highly optimized image scaling, color, pixel format conversion operation

libswresample: audio resampling performed highly optimized, in terms of weight, the sample format conversion operation

 

Guess you like

Origin www.cnblogs.com/liushuchen/p/11313724.html