Skip to content

Commit 2b392ad

Browse files
committed
2 parents 30d8a9e + 8a3ac82 commit 2b392ad

8 files changed

+190
-1
lines changed

cross_compile_ffmpeg.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,10 @@ build_ffmpeg() {
23922392

23932393
config_options+=" --extra-libs=-lharfbuzz" # grr...needed for pre x264 build???
23942394
config_options+=" --extra-libs=-lm" # libflite seemed to need this linux native...and have no .pc file huh?
2395-
config_options+=" --extra-libs=-lshlwapi" # lame needed this, no .pc file?
2395+
2396+
if [[ $compiler_flavors != "native" ]]; then
2397+
config_options+=" --extra-libs=-lshlwapi" # lame needed this, no .pc file?
2398+
fi
23962399
config_options+=" --extra-libs=-lmpg123" # ditto
23972400
config_options+=" --extra-libs=-lpthread" # for some reason various and sundry needed this linux native
23982401

extra/README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# ffmpeg windows cross compile helper extra script
2+
3+
* This is Patch for Windows WSL Ubuntu
4+
* FFmpeg 4.4.3 for Windows 64-bit with FDK-AAC(--disable-nonfree=n, --build-ffmpeg-static=y)
5+
* disable Tesseract OCR function
6+
7+
* Environment
8+
9+
| Windows | WSL Linux | Result |
10+
| ---- | ---- | ---- |
11+
| Windows 11 | Ubuntu 22.04 | **OK** (Recommend) |
12+
| Windows 11 | Ubuntu 20.04 | **OK** |
13+
| Windows 11 | Debian 11.6 | Your own risk |
14+
| Windows 10 | Ubuntu 20.04 | **OK** (Recommend) |
15+
| Windows 10 | Debian 9.5 | NG |
16+
| Windows | Other | Not Tested |
17+
18+
# How to use
19+
1) Enable WSL and Install Ubuntu via Windows Command-Line
20+
```
21+
wsl --install
22+
or
23+
wsl --install -d Ubuntu
24+
```
25+
2) Type following to Build FFmpeg automatically
26+
```
27+
cd
28+
git clone https://github.com/rdp/ffmpeg-windows-build-helpers
29+
cd ffmpeg-windows-build-helpers
30+
31+
# Windows 11 WLS Ubuntu
32+
./extra/make.sh
33+
34+
or
35+
36+
# Windows 10 WLS Ubuntu
37+
./extra/make_win10.sh
38+
39+
* FFmpeg is Win64 (64-bit only).
40+
Edit ./extra/build.sh if you want the 32-bit version .
41+
```
42+
3) Wait a few hours
43+
Take about 1 to few hours depending on machine specs
44+
45+
| CPU | WSL Linux | Build Time |
46+
| ---- | ---- | ---- |
47+
| Ryzen 5 PRO 3400GE | Windows 11 WSL Ubuntu 22.04 | 90 min |
48+
| Ryzen 5 PRO 3400GE | Windows 11 WSL Ubuntu 20.04 | 75 min |
49+
| Ryzen 7 PRO 4750G | Windows 10 WSL Ubuntu 20.04 | 111 min |
50+
51+
# for more details visit following URL
52+
http://www.neko.ne.jp/~freewing/software/windows_compile_ffmpeg_enable_fdk_aac/
53+

extra/build.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
# ffmpeg windows cross compile helper extra script, see github repo README
3+
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
4+
# set -x
5+
6+
echo "FFmpeg 4.4.3 for Windows"
7+
echo "Default: --build-ffmpeg-static=y --build-intel-qsv=y --build-amd-amf=y"
8+
echo "Add Args: --disable-nonfree=n --ffmpeg-git-checkout-version=n4.4.3"
9+
10+
# --compiler-flavors=multi,win32,win64
11+
time ./cross_compile_ffmpeg.sh --disable-nonfree=n --ffmpeg-git-checkout-version=n4.4.3 --compiler-flavors=win64
12+

extra/disable_git_sslverify.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# ffmpeg windows cross compile helper extra script, see github repo README
3+
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
4+
# set -x
5+
6+
echo "This is Patch for Git clone from code.videolan.org"
7+
# fatal: unable to access 'https://code.videolan.org/videolan/x264.git/': server certificate verification failed. CAfile: none CRLfile: none
8+
9+
echo "Disable Git server certificate verification"
10+
git config --global http.sslverify false
11+

extra/make.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# ffmpeg windows cross compile helper extra script, see github repo README
3+
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
4+
# set -x
5+
6+
echo "FFmpeg 4.4.3 for Windows"
7+
echo "Make file for WSL Ubuntu"
8+
9+
# WSL Debian
10+
# if [ -f /etc/debian_version ]; then
11+
# echo "Not Support Windows 10 WSL Debian"
12+
# echo "Please use Ubuntu"
13+
# exit 1
14+
# fi
15+
16+
# Windows 10 WSL Debian 9.5
17+
grep -E "^9" /etc/debian_version && echo "Not Support Windows 10 WSL Debian 9.x" && echo "Please use Ubuntu or Windows 11"
18+
19+
bash ./extra/wsl_patch.sh
20+
21+
echo $'\a'
22+
bash ./extra/build.sh
23+
echo $'\a'
24+

extra/make_win10.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
# ffmpeg windows cross compile helper extra script, see github repo README
3+
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
4+
# set -x
5+
6+
echo "FFmpeg 4.4.3 for Windows"
7+
echo "Make file for WSL Ubuntu"
8+
9+
# WSL Debian
10+
# if [ -f /etc/debian_version ]; then
11+
# echo "Not Support Windows 10 WSL Debian"
12+
# echo "Please use Ubuntu"
13+
# exit 1
14+
# fi
15+
16+
# Windows 10 WSL Debian 9.5
17+
grep -E "^9" /etc/debian_version && echo "Not Support Windows 10 WSL Debian 9.x" && echo "Please use Ubuntu or Windows 11"
18+
19+
bash ./extra/wsl_patch.sh
20+
21+
echo "Windows 10 Ubuntu 20.04 Trouble patch"
22+
bash ./extra/wsl_win10_ubuntu_2004_patch.sh
23+
24+
echo "Windows 10 Ubuntu 20.04 Trouble patch"
25+
bash ./extra/disable_git_sslverify.sh
26+
27+
echo $'\a'
28+
bash ./extra/build.sh
29+
echo $'\a'
30+

extra/wsl_patch.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
# ffmpeg windows cross compile helper extra script, see github repo README
3+
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
4+
# set -x
5+
6+
echo "This is Patch for WSL Ubuntu"
7+
8+
echo "Disable Tesseract OCR function"
9+
# ERROR: tesseract not found using pkg-config
10+
# Disable Tesseract OCR function
11+
sed -i -e "s/ build_libtesseract/ # build_libtesseract/g" cross_compile_ffmpeg.sh
12+
sed -i -e "s/--enable-libtesseract//g" cross_compile_ffmpeg.sh
13+
14+
echo "Windows WSL 'binfmt'"
15+
if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then
16+
echo "Windows WSL Disable 'binfmt'"
17+
sudo bash -c 'echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop'
18+
fi
19+
20+
echo "Update Package Index file"
21+
sudo apt-get update -q
22+
23+
echo "Install missing Packages"
24+
25+
# Debian
26+
sudo apt-get install wget -y -q
27+
28+
# Debian: lensfun ModureNotFoundError: No module named 'setuptools'
29+
# Ubuntu: lensfun_git from setuptools import setup
30+
sudo apt-get install python3-setuptools -y -q
31+
32+
echo "Install necessary Packages"
33+
sudo apt-get install subversion ragel curl texinfo g++ ed bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev unzip pax nasm gperf autogen bzip2 autoconf-archive p7zip-full meson clang -y -q
34+
sudo apt-get install libtool-bin ed -y -q
35+
sudo apt-get install python3-distutils -y -q
36+
sudo apt-get install python-is-python3 -y -q
37+
38+
echo "Next Execute './extra/build.sh'"
39+

extra/wsl_win10_ubuntu_2004_patch.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
# ffmpeg windows cross compile helper extra script, see github repo README
3+
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
4+
# set -x
5+
6+
echo "This is Patch for Windows 10 WSL Ubuntu 20.04"
7+
echo "libsndfile fails to build on Ubuntu 20.04 with WSL #452"
8+
echo "https://github.com/rdp/ffmpeg-windows-build-helpers/issues/452"
9+
10+
sudo dpkg -r --force-depends "libgc1c2" # remove old libgc
11+
12+
git clone https://github.com/ivmai/bdwgc --depth 1
13+
cd bdwgc
14+
./autogen.sh
15+
./configure --prefix=/usr && make -j # its default is the wrong directory? huh?
16+
sudo make install
17+

0 commit comments

Comments
 (0)