@@ -476,6 +476,70 @@ do_cmake_and_install() {
476
476
do_make_and_make_install
477
477
}
478
478
479
+ do_meson () {
480
+ local configure_options=" $1 "
481
+ local configure_name=" $2 "
482
+ local configure_env=" $3 "
483
+ local configure_noclean=" "
484
+ if [[ " $configure_name " = " " ]]; then
485
+ configure_name=" meson"
486
+ fi
487
+ local cur_dir2=$( pwd)
488
+ local english_name=$( basename $cur_dir2 )
489
+ local touch_name=$( get_small_touchfile_name already_built " $configure_options $configure_name $LDFLAGS $CFLAGS " )
490
+ if [ ! -f " $touch_name " ]; then
491
+ if [ " $configure_noclean " != " noclean" ]; then
492
+ make clean # just in case
493
+ fi
494
+ rm -f already_* # reset
495
+ echo " Using meson: $english_name ($PWD ) as $ PATH=$PATH ${configure_env} $configure_name $configure_options "
496
+ # env
497
+ " $configure_name " $configure_options || exit 1
498
+ touch -- " $touch_name "
499
+ make clean # just in case
500
+ else
501
+ echo " Already used meson $( basename $cur_dir2 ) "
502
+ fi
503
+ }
504
+
505
+ generic_meson () {
506
+ local extra_configure_options=" $1 "
507
+ mkdir -pv build
508
+ do_meson " --prefix=${mingw_w64_x86_64_prefix} --libdir=${mingw_w64_x86_64_prefix} /lib --buildtype=release --strip --default-library=static --cross-file=${top_dir} /meson-cross.mingw.txt $extra_configure_options . build"
509
+ }
510
+
511
+ generic_meson_ninja_install () {
512
+ generic_meson " $1 "
513
+ do_ninja_and_ninja_install
514
+ }
515
+
516
+ do_ninja_and_ninja_install () {
517
+ local extra_ninja_options=" $1 "
518
+ do_ninja " $extra_ninja_options "
519
+ local touch_name=$( get_small_touchfile_name already_ran_make_install " $extra_ninja_options " )
520
+ if [ ! -f $touch_name ]; then
521
+ echo " ninja installing $( pwd) as $ PATH=$PATH ninja -C build install $extra_make_options "
522
+ ninja -C build install || exit 1
523
+ touch $touch_name || exit 1
524
+ fi
525
+ }
526
+
527
+ do_ninja () {
528
+ local extra_make_options=" -j $cpu_count "
529
+ local cur_dir2=$( pwd)
530
+ local touch_name=$( get_small_touchfile_name already_ran_make " ${extra_make_options} " )
531
+
532
+ if [ ! -f $touch_name ]; then
533
+ echo
534
+ echo " ninja-ing $cur_dir2 as $ PATH=$PATH ninja -C build " ${extra_make_options} "
535
+ echo
536
+ ninja -C build " ${extra_make_options} || exit 1
537
+ touch $touch_name || exit 1 # only touch if the build was OK
538
+ else
539
+ echo " already did ninja $( basename " $cur_dir2 " ) "
540
+ fi
541
+ }
542
+
479
543
apply_patch () {
480
544
local url=$1 # if you want it to use a local file instead of a url one [i.e. local file with local modifications] specify it like file://localhost/full/path/to/filename.patch
481
545
local patch_type=$2
@@ -1338,35 +1402,6 @@ build_frei0r() {
1338
1402
cd ..
1339
1403
}
1340
1404
1341
- build_svt-hevc () {
1342
- do_git_checkout https://github.com/OpenVisualCloud/SVT-HEVC.git
1343
- mkdir -p SVT-HEVC_git/release
1344
- cd SVT-HEVC_git/release
1345
- do_cmake_from_build_dir .. " -DCMAKE_BUILD_TYPE=Release"
1346
- do_make_and_make_install
1347
- cd ../..
1348
- }
1349
-
1350
- build_svt-av1 () {
1351
- do_git_checkout https://github.com/OpenVisualCloud/SVT-AV1.git
1352
- cd SVT-AV1_git
1353
- git apply $patch_dir /SVT-AV1-Windows-lowercase.patch
1354
- cd Build
1355
- do_cmake_from_build_dir .. " -DCMAKE_BUILD_TYPE=Release"
1356
- do_make_and_make_install
1357
- cd ../..
1358
- }
1359
-
1360
- build_svt-vp9 () {
1361
- do_git_checkout https://github.com/OpenVisualCloud/SVT-VP9.git
1362
- cd SVT-VP9_git
1363
- git apply $patch_dir /SVT-VP9-Windows-lowercase.patch
1364
- cd Build
1365
- do_cmake_from_build_dir ..
1366
- do_make_and_make_install
1367
- cd ../..
1368
- }
1369
-
1370
1405
build_vidstab () {
1371
1406
do_git_checkout https://github.com/georgmartius/vid.stab.git vid.stab_git
1372
1407
cd vid.stab_git
@@ -1506,6 +1541,13 @@ build_libaom() {
1506
1541
cd ../..
1507
1542
}
1508
1543
1544
+ build_dav1d () {
1545
+ do_git_checkout https://code.videolan.org/videolan/dav1d.git libdav1d
1546
+ cd libdav1d
1547
+ generic_meson_ninja_install
1548
+ cd ..
1549
+ }
1550
+
1509
1551
build_libx265 () {
1510
1552
# the only one that uses mercurial, so there's some extra initial junk in this method... XXX needs some cleanup :|
1511
1553
local checkout_dir=x265
@@ -1838,6 +1880,26 @@ reset_cflags() {
1838
1880
export CFLAGS=$original_cflags
1839
1881
}
1840
1882
1883
+ build_meson_cross () {
1884
+ rm -fv meson-cross.mingw.txt
1885
+ echo " [binaries]" >> meson-cross.mingw.txt
1886
+ echo " c = '${cross_prefix} gcc'" >> meson-cross.mingw.txt
1887
+ echo " cpp = '${cross_prefix} g++'" >> meson-cross.mingw.txt
1888
+ echo " ar = '${cross_prefix} ar'" >> meson-cross.mingw.txt
1889
+ echo " strip = '${cross_prefix} strip'" >> meson-cross.mingw.txt
1890
+ echo " pkgconfig = '${cross_prefix} pkg-config'" >> meson-cross.mingw.txt
1891
+ echo " nm = '${cross_prefix} nm'" >> meson-cross.mingw.txt
1892
+ echo " windres = '${cross_prefix} windres'" >> meson-cross.mingw.txt
1893
+ # echo "[properties]" >> meson-cross.mingw.txt
1894
+ # echo "needs_exe_wrapper = true" >> meson-cross.mingw.txt
1895
+ echo " [host_machine]" >> meson-cross.mingw.txt
1896
+ echo " system = 'windows'" >> meson-cross.mingw.txt
1897
+ echo " cpu_family = 'x86_64'" >> meson-cross.mingw.txt
1898
+ echo " cpu = 'x86_64'" >> meson-cross.mingw.txt
1899
+ echo " endian = 'little'" >> meson-cross.mingw.txt
1900
+ mv -v meson-cross.mingw.txt ../..
1901
+ }
1902
+
1841
1903
build_mplayer () {
1842
1904
# pre requisites
1843
1905
build_libjpeg_turbo
@@ -1959,21 +2021,6 @@ build_ffmpeg() {
1959
2021
1960
2022
cd $output_dir
1961
2023
apply_patch file://$patch_dir /frei0r_load-shared-libraries-dynamically.diff
1962
- # SVT-HEVC
1963
- wget https://raw.githubusercontent.com/OpenVisualCloud/SVT-HEVC/master/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch
1964
- git am 0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch
1965
- # Add SVT-AV1 to SVT-HEVC
1966
- # wget https://raw.githubusercontent.com/OpenVisualCloud/SVT-AV1/master/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1-with-svt-hevc.patch
1967
- # git apply 0001-Add-ability-for-ffmpeg-to-run-svt-av1-with-svt-hevc.patch
1968
- # Add SVT-VP9 to SVT-HEVC & SVT-AV1
1969
- # wget https://raw.githubusercontent.com/OpenVisualCloud/SVT-VP9/master/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-vp9-with-svt-hevc-av1.patch
1970
- # git apply 0001-Add-ability-for-ffmpeg-to-run-svt-vp9-with-svt-hevc-av1.patch
1971
- # SVT-AV1 only
1972
- # wget https://raw.githubusercontent.com/OpenVisualCloud/SVT-AV1/master/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
1973
- # git apply 0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
1974
- # SVT-VP9 only
1975
- # wget https://raw.githubusercontent.com/OpenVisualCloud/SVT-VP9/master/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch
1976
- # git apply 0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch
1977
2024
1978
2025
if [ " $bits_target " = " 32" ]; then
1979
2026
local arch=x86
@@ -1995,9 +2042,7 @@ build_ffmpeg() {
1995
2042
# Fix WinXP incompatibility by disabling Microsoft's Secure Channel, because Windows XP doesn't support TLS 1.1 and 1.2, but with GnuTLS or OpenSSL it does. XP compat!
1996
2043
fi
1997
2044
config_options=" $init_options --enable-libcaca --enable-gray --enable-libtesseract --enable-fontconfig --enable-gmp --enable-gnutls --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-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-libmysofa --enable-libaom --enable-libopenjpeg --enable-libopenh264 --enable-liblensfun --enable-libvmaf --enable-libsrt --enable-demuxer=dash --enable-libxml2"
1998
- config_options+=" --enable-libsvthevc"
1999
- # config_options+=" --enable-libsvtav1"
2000
- # config_options+=" --enable-libsvtvp9"
2045
+ config_options+=" --enable-libdav1d"
2001
2046
if [[ $compiler_flavors != " native" ]]; then
2002
2047
config_options+=" --enable-nvenc --enable-nvdec" # don't work OS X
2003
2048
fi
@@ -2152,6 +2197,7 @@ build_ffmpeg_dependencies() {
2152
2197
build_dlfcn
2153
2198
build_libxavs
2154
2199
fi
2200
+ build_meson_cross
2155
2201
build_mingw_std_threads
2156
2202
build_zlib # Zlib in FFmpeg is autodetected.
2157
2203
build_libcaca # Uses zlib and dlfcn (on windows).
@@ -2208,9 +2254,6 @@ build_ffmpeg_dependencies() {
2208
2254
build_libsamplerate # Needs libsndfile >= 1.0.6 and fftw >= 0.15.0 for tests. Uses dlfcn.
2209
2255
build_librubberband # Needs libsamplerate, libsndfile, fftw and vamp_plugin. 'configure' will fail otherwise. Eventhough librubberband doesn't necessarily need them (libsndfile only for 'rubberband.exe' and vamp_plugin only for "Vamp audio analysis plugin"). How to use the bundled libraries '-DUSE_SPEEX' and '-DUSE_KISSFFT'?
2210
2256
build_frei0r # Needs dlfcn. could use opencv...
2211
- build_svt-hevc
2212
- # build_svt-av1
2213
- # build_svt-vp9
2214
2257
build_vidstab
2215
2258
# build_facebooktransform360 # needs modified ffmpeg to use it
2216
2259
build_libmysofa # Needed for FFmpeg's SOFAlizer filter (https://ffmpeg.org/ffmpeg-filters.html#sofalizer). Uses dlfcn.
@@ -2231,6 +2274,7 @@ build_ffmpeg_dependencies() {
2231
2274
build_libx265
2232
2275
build_libopenh264
2233
2276
build_libaom
2277
+ build_dav1d
2234
2278
build_libx264 # at bottom as it might internally build a coy of ffmpeg (which needs all the above deps...
2235
2279
}
2236
2280
@@ -2263,6 +2307,7 @@ build_apps() {
2263
2307
}
2264
2308
2265
2309
# set some parameters initial values
2310
+ top_dir=" $( pwd) "
2266
2311
cur_dir=" $( pwd) /sandbox"
2267
2312
patch_dir=" $( pwd) /patches"
2268
2313
cpu_count=" $( grep -c processor /proc/cpuinfo 2> /dev/null) " # linux cpu count
0 commit comments