Make a note so that you do not forget it.
I will build it with the feeling that it is OK if it works for the time being, so I will ignore warnings and so on. ** I am not responsible for any problems with building with the steps in this article. Please take responsibility for your actions. ** **
It's very easy because a dedicated tool is prepared.
This time I used Ubuntu 20.4 ja. VMware Workstation 15 Player was used as the virtualization software. It also works on WSL.
The directory can be anywhere under the home directory.
git clone https://github.com/rdp/ffmpeg-windows-build-helpers.git
cd ffmpeg-windows-build-helpers
I will execute it for the time being.
./cross_compile_ffmpeg.sh
Then, a command like sudo apt install 〇〇 will appear in the log, so copy it and execute it.
sudo apt-get install subversion ragel curl texinfo g++ bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev mercurial unzip pax nasm gperf autogen bzip2 autoconf-archive p7zip-full clang python3 python3-pip python3-setuptools python3-wheel ninja-build -y
For Ubuntu 18.04
sudo apt install python3-distutils -y
For Ubuntu 20.04
sudo apt install python-is-python3 -y
Is required.
Then install the other things you need.
sudo apt install python3-pip -y
sudo pip3 install ninja meson
./cross_compile_ffmpeg.sh --build-ffmpeg-shared=y --build-intel-qsv=y --build-amd-amf=y --ffmpeg-git-checkout-version=n4.3.1 --enable-gpl=n
I ran it like this. It will take several hours. Build with 32bit and 64bit as the target, or choose only one.
I wanted a dll, so I made it generate a dll with --build-ffmpeg-shared = y. If you don't need it, use --build-ffmpeg-static = y.
--build-intel-qsv=y --build-amd-amf=y Now enable Intel QSV, AMD amf as an option. NVENC and NVDEC seem to be enabled automatically.
--enable-gpl = n disables libx264. --enable-gpl = y will install libx264. Apparently OpenH264 is used as standard.
Specify the version of ffmpeg with --ffmpeg-git-checkout-version = n4.3.1. If you do not specify it, the latest file will be dropped. This tool seems to be made for the latest version, so if you do not specify the latest version, you may get an error.
For other detailed settings, you may want to look inside the sh file. If you want to change it in detail, you should rewrite it directly.
Done! You will find 32-bit shared binaries in /home/kusaanko/ffmpeg-windows-build-helpers/sandbox/win32/ffmpeg_git_lgpl_n4.3.1_shared/bin
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=ja_JP.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (906E9),ASM,AES-NI)
Scanning the drive:
9 folders, 145 files, 82126029 bytes (79 MiB)
Creating archive: /home/kusaanko/ffmpeg-windows-build-helpers/sandbox/redist/ffmpeg-N-98189-g6b6b9e593d-win32-shared.7z
Items to compress: 154
Files read from disk: 145
Archive size: 27850375 bytes (27 MiB)
Everything is Ok
In my case it was here. ffmpeg-windows-build-helpers/sandbox/win64/ffmpeg_git_lgpl_n4.3.1_shared/bin/ You can see it by reading it because it appears in the last log.
ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl. The latest version of libaribb24 is 1.0.3, but a newer version than 1.0.3 is requested. Give up building with LGPL or give up on bundling. Click here for the command to give up the package
sed -i -e 's/--enable-libaribb24 //' ./cross_compile_ffmpeg.sh
sed -i -e 's/--enable-libx264 --enable-libx265/--enable-libx264 --enable-libx265 --enable-libaribb24/' ./cross_compile_ffmpeg.sh
Be careful with your license when using ffmpeg. You have to think about license fees and so on.
Recommended Posts