Build ffmpeg 4.3.1 on Ubuntu for Windows

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.

Ubuntu settings

This time I used Ubuntu 20.4 ja. VMware Workstation 15 Player was used as the virtualization software. It also works on WSL.

Tool download

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

Download required packages

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

Build ffmpeg

./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.

Build completion log

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

Location of completed files

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

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

Finally

Be careful with your license when using ffmpeg. You have to think about license fees and so on.

Recommended Posts

Build ffmpeg 4.3.1 on Ubuntu for Windows
Ubuntu on Windows build speed
Build Zabbix on Ubuntu 20.04
Build VNC Server on Ubuntu 20.04
Ubuntu on Windows Community Preview
Manually build OpenJDK on Windows
Build the latest Samba 4 on Ubuntu 20.04
Build a XAMPP environment on Ubuntu
How to build vim on Ubuntu 20.04
GraalVM for Java Performance (Windows Developer Build)
Countermeasures for FDclone build failure on CentOS 8
Run NordVPN on Docker (Windows) Ubuntu container
Introducing Docker Desktop for Windows on WSL2
Build OpenCV with Java Wrapper on Ubuntu 18.04
tmux on Ubuntu
Manually build OpenJDK on Windows
Ubuntu on Windows build speed
Error when npm install on Windows 7
Build ffmpeg 4.3.1 on Ubuntu for Windows
Build and install Wireshark Development Release (3.3.1) on Ubuntu
[Java] Build Java development environment on Ubuntu & check execution
Build a DHCP and NAT router on Ubuntu 16.04
Operate Docker Desktop for Windows on Linux (WSL)
How to build a Pytorch environment on Ubuntu
Note Book: OpenCV v4.5.0-dev On Ubuntu 20.04 But Didn't work cmake build for Java
Screen recording on Ubuntu 20.04
Web Bluetooth on Ubuntu20.04
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
Install Corretto 8 on Windows
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
I built an Ubuntu environment on Windows 10 using WSL2.
Use Flutter on Ubuntu
Install pyqt5 on ubuntu
Easily build Redmine on Windows using WSL2 and Docker
Install Ruby on Ubuntu 20.04
[Note] I suddenly can't build with Docker for windows.
I tried using Docker Desktop for Windows on Windows 10 Home
Setting JAVA_HOME on Ubuntu
Install Autoware on Ubuntu 18.04.5
(For myself) Build gitlab with ubuntu18.04 + docker for home (Note)
Put JetBrains on Ubuntu
Use mkdir on ubuntu
Apache2 on Ubuntu20.04 LTS
ubuntu on wsl part 10
Install Homebrew on Ubuntu 20.04
Run tiscamera on Ubuntu 18.04
M.S. docker on Windows
Talk about introducing Ubuntu 20.04 on Windows 10 and text editor
Wifi adapter not recognized on Ubuntu with Windows dual boot
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
Configuration script for using docker in proxy environment on ubuntu 20.04.1
Using Flutter on Ubuntu (Part 2)
Create SSL certificate on Ubuntu 18.04
Building WebGIS on Ubuntu20.04 LTS
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Extend swap area on Ubuntu 18.04
Install Docker on Ubuntu Server 20.04
Japanese input on Ubuntu20.04 Desktop
Run openvpn on Docker (windows)
Try Docker on Windows 10 Home
Oracle Java 8 on Docker Ubuntu
Install MAV Proxy on Ubuntu 18.04