Notes: Windows Compilation of FFmpeg

Ffmpeg directly click to download

No need to choose, otherwise, the files will be incomplete after installation (from the video) (should be clicked to download, the corresponding model will be automatically downloaded according to the local model)

No bin file (add environment variables)

will (all)

Paste it into the newly downloaded ffmpeg file, and skip it repeatedly. Then reconfigure the environment variable (put the directory where the bin file is located) in the path. (This is the ffmpeg downloaded by the previous method)

Take the name 'Compile ffmpeg source code on windows platform, debug ffplay' on station b. This video is for vs, but we can use it for msys configuration.

On the official website http://msys2.org , the downloaded msys prompts that my computer is unavailable, but the msys I downloaded before is still there, so I use the one I downloaded earlier.

step

1 Data source update

Server = https://mirrors.ustc.edu.cn/msys2/mingw/i686

Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/

Server = https://mirrors.ustc.edu.cn/msys2/mingw/$arc

Put these three addresses into the first line of the three files respectively. (by catalog)

open msys

Type pacman –Sy

2 Edit the startup program of msys

Follow the operation on the video to find this

The specific path is C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat

Edit the startup program of msys

Find the .cmd file, right-click, select Edit, and make two changes: one is to add

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"

In addition, it is to remove the comment rem of set MSYS2_PATH_TYPE=inherit, so that msys can use the environment variables on windows, etc.

3 Set the msys tool (not setting does not affect compilation, just to avoid garbled characters)

Open msys, right click on options (options) --text—

4 installation tools

Enter the ffmpeg file (cd e:/ffmpeg/ffmpeg/)

Install the four small tools used for compilation and install

pacman –S yasm make pkg-config diffutils

($ ./configure --enable-shared –enable-postproc --enable-avresample --enable-gpl --toolchain=msvs--disable-debug --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-symver --disable-stripping --prefix=./build

But an error was reported, saying to ensure the latest, so I updated the following

pacman -S --needed base-devel mingw-w64-x86_64-toolchain

Some successes, but there are still a lot of errors, in progress./configure --enable-shared --enable-postproc --enable-avresample --enable-gpl --toolchain=msvs--disable-debug --disable-static - -disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-symver --disable-stripping --prefix=./build

Still the same error, simply don't use it, just ./configure

got the final result)

5 compile ffmpeg

./configure

(the wait time is not long)

make

(Long waiting time, 6 hours, computer problems)

make install

And that's all there is to it.

To sum up, taking the book (ffmpeg from entry to proficiency) as an example, all you need to do is to download ffmpeg (I downloaded two kinds, and finally put them in the same folder, one has a bin file, can add environment variables, and the other One can be configured); to download msys2, there is no need to download mingw64, because it is available in msys2. For the configuration of msys, it is necessary to update the data source; edit the startup program; install the tool; finally configure.

Original link: Notes: FFmpeg Windows compilation_ffmpeg win compilation_m0_50140251's blog-CSDN blog

★The business card at the end of the article can receive audio and video development learning materials for free, including (FFmpeg, webRTC, rtmp, hls, rtsp, ffplay, srs) and audio and video learning roadmaps, etc.

see below!

 

Guess you like

Origin blog.csdn.net/yinshipin007/article/details/131648443