Skip to content

Commit

Permalink
Merge pull request #714 from FREEWING-JP/extra_script_ver_4_4_4
Browse files Browse the repository at this point in the history
Update extra Script for WSL Ubuntu to More Easily build FFmpeg 4.4.4
  • Loading branch information
rdp committed Oct 16, 2023
2 parents 6e49997 + d016ac2 commit 44ea850
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 6 deletions.
21 changes: 20 additions & 1 deletion extra/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ffmpeg windows cross compile helper extra script

* 2023/10/15 FFmpeg 4.4.4

* This is Patch for Windows WSL Ubuntu
* FFmpeg 4.4.3 for Windows 64-bit with FDK-AAC(--disable-nonfree=n, --build-ffmpeg-static=y)
* FFmpeg 4.4.4 for Windows 64-bit with FDK-AAC(--disable-nonfree=n, --build-ffmpeg-static=y)
* disable Tesseract OCR function

* Environment
Expand Down Expand Up @@ -47,7 +49,24 @@ Take about 1 to few hours depending on machine specs
| Ryzen 5 PRO 3400GE | Windows 11 WSL Ubuntu 22.04 | 90 min |
| Ryzen 5 PRO 3400GE | Windows 11 WSL Ubuntu 20.04 | 75 min |
| Ryzen 7 PRO 4750G | Windows 10 WSL Ubuntu 20.04 | 111 min |
| Core i5-8259U | Windows 10 WSL Ubuntu 20.04 | 172 min |

# for more details visit following URL
http://www.neko.ne.jp/~freewing/software/windows_compile_ffmpeg_enable_fdk_aac/

# 2023/10/15 FFmpeg 4.4.4 ffmpeg.exe -version
```
ffmpeg.exe -version
ffmpeg version n4.4.4-ffmpeg-windows-build-helpers Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10.2.0 (GCC)
configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=ffmpeg-windows-build-helpers --enable-version3 --disable-debug --disable-w32threads --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/user/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --enable-libcaca --enable-gray --enable-fontconfig --enable-gmp --enable-libass --enable-libbluray --enable-libbs2b --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libwebp --enable-libzimg --enable-libzvbi --enable-libmysofa --enable-libopenjpeg --enable-libopenh264 --enable-libvmaf --enable-libsrt --enable-libxml2 --enable-opengl --enable-libdav1d --enable-cuda-llvm --enable-gnutls --enable-libsvtav1 --enable-libvpx --enable-libaom --enable-nvenc --enable-nvdec --extra-libs=-lharfbuzz --extra-libs=-lm --extra-libs=-lshlwapi --extra-libs=-lmpg123 --extra-libs=-lpthread --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCACA_STATIC --enable-amf --enable-libmfx --enable-gpl --enable-frei0r --enable-librubberband --enable-libvidstab --enable-libx264 --enable-libx265 --enable-avisynth --enable-libaribb24 --enable-libxvid --enable-libdavs2 --enable-libxavs2 --enable-libxavs --extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-shared --prefix=/home/user/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-libdav1d --enable-nonfree --enable-libfdk-aac --enable-decklink
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
```

12 changes: 9 additions & 3 deletions extra/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
# set -x

echo "FFmpeg 4.4.3 for Windows"
echo "Windows WSL patch"
bash ./extra/wsl_patch_2023_05_for_n4_4_x.sh
bash ./extra/wsl_patch_2023_10_for_n4_4_x.sh

FFMPEG_VER=4.4.4

echo "FFmpeg "$FFMPEG_VER" for Windows"
echo "Default: --build-ffmpeg-static=y --build-intel-qsv=y --build-amd-amf=y"
echo "Add Args: --disable-nonfree=n --ffmpeg-git-checkout-version=n4.4.3"
echo "Add Args: --disable-nonfree=n --ffmpeg-git-checkout-version=n"$FFMPEG_VER

# --compiler-flavors=multi,win32,win64
time ./cross_compile_ffmpeg.sh --disable-nonfree=n --ffmpeg-git-checkout-version=n4.4.3 --compiler-flavors=win64
time ./cross_compile_ffmpeg.sh --disable-nonfree=n --ffmpeg-git-checkout-version=n"$FFMPEG_VER" --compiler-flavors=win64

19 changes: 19 additions & 0 deletions extra/copy_ffmpeg_exe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# ffmpeg windows cross compile helper extra script, see github repo README
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
# set -x

echo "Copy FFmpeg execute files to Windows C:\ffmpeg_tmp directory"

ls -l ./sandbox/win64/ffmpeg_git_with_fdk_aac_n4.4.4/ff*.exe
ls -l ./sandbox/win64/x264/x*.exe
ls -l ./sandbox/win64/x265/8bit/x*.exe

mkdir /mnt/c/ffmpeg_tmp/
cp ./sandbox/win64/ffmpeg_git_with_fdk_aac_n4.4.4/ff*.exe /mnt/c/ffmpeg_tmp/
cp ./sandbox/win64/x264/x*.exe /mnt/c/ffmpeg_tmp/
cp ./sandbox/win64/x265/8bit/x*.exe /mnt/c/ffmpeg_tmp/
rm /mnt/c/ffmpeg_tmp/ff*_g.exe

ls -l /mnt/c/ffmpeg_tmp/

2 changes: 1 addition & 1 deletion extra/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
# set -x

echo "FFmpeg 4.4.3 for Windows"
echo "FFmpeg for Windows 11"
echo "Make file for WSL Ubuntu"

# WSL Debian
Expand Down
2 changes: 1 addition & 1 deletion extra/make_win10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
# set -x

echo "FFmpeg 4.4.3 for Windows"
echo "FFmpeg for Windows 10"
echo "Make file for WSL Ubuntu"

# WSL Debian
Expand Down
17 changes: 17 additions & 0 deletions extra/wsl_patch_2023_05_for_n4_4_x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# ffmpeg windows cross compile helper extra script, see github repo README
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
# set -x

echo "This is Patch for WSL Ubuntu 2023/05/05"

echo "2023/05/05 no member named 'compressed_ten_bit_format'"
# libavcodec/libsvtav1.c:124:51: error: 'EbSvtAv1EncConfiguration' has no member named 'compressed_ten_bit_format'
# 124 | (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0;
# sed -i -e "s/SVT-AV1\.git$/SVT-AV1.git SVT-AV1_git v1.4.1/g" cross_compile_ffmpeg.sh

# https://github.com/FFmpeg/FFmpeg/commit/031f1561cd286596cdb374da32f8aa816ce3b135
# avcodec/libsvtav1: remove compressed_ten_bit_format and simplify allo…
# patch git cherry-pick 031f156
sed -i -e "s/ cd \$output_dir/ cd \$output_dir\n git cherry-pick 031f156/g" cross_compile_ffmpeg.sh

29 changes: 29 additions & 0 deletions extra/wsl_patch_2023_10_for_n4_4_x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# ffmpeg windows cross compile helper extra script, see github repo README
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
# set -x

echo "This is Patch for WSL Ubuntu 2023/10/15"

echo "2023/10/15 Disable libaribcaption --enable-libaribcaption"
# Because FFmpeg 4.4.x doesn't have this option
# #693 --enable-libaribcaption #694
# https://github.com/rdp/ffmpeg-windows-build-helpers/pull/694
# config_options+=" --enable-libaribcaption" # libaribcatption (MIT licensed)
sed -i -e "s/--enable-libaribcaption//g" cross_compile_ffmpeg.sh
sed -i -e "s/ build_libaribcaption/ # build_libaribcaption/g" cross_compile_ffmpeg.sh

# echo "2023/10/15 Disable nvenc --enable-nvenc --enable-nvdec"
# Because 2023/10/06 latest master as 75f032b n12.1.14.1 Cause ERROR: nvenc requested but not found
# and I have no NVIDIA graphics card
# config_options+=" --enable-nvenc --enable-nvdec" # don't work OS X
# sed -i -e "s/--enable-nvenc --enable-nvdec//g" cross_compile_ffmpeg.sh

echo "2023/10/15 nvenc nv-codec-headers n12.0.16.1"
# https://github.com/FFmpeg/nv-codec-headers/releases/tag/n12.0.16.1
# Because 2023/10/06 latest master as 75f032b n12.1.14.1 Cause ERROR: nvenc requested but not found
# https://github.com/FFmpeg/nv-codec-headers/commit/75f032b24263c2b684b9921755cafc1c08e41b9d
# Because 2023/10/06 n12.1.14.0 Cause error: 'NV_ENC_PARAMS_RC_VBR_MINQP' undeclared here
# https://github.com/FFmpeg/nv-codec-headers/releases/tag/n12.1.14.0
sed -i -e "s/nv-codec-headers\.git$/nv-codec-headers.git nv-codec-headers_git n12.0.16.1/g" cross_compile_ffmpeg.sh

0 comments on commit 44ea850

Please sign in to comment.