1616 - os : ubuntu-latest
1717 CC : gcc
1818 CXX : g++
19+ ffmpeg_build : autotools
1920 - os : macos-latest
2021 CC : clang
2122 CXX : clang++
23+ ffmpeg_build : autotools
24+ - os : windows-latest
25+ CC : cl
26+ CXX : cl
27+ ffmpeg_build : meson
2228 runs-on : ${{ matrix.os }}
2329 env :
2430 CC : ${{ matrix.CC }}
3137 - name : Install meson and ninja
3238 run : |
3339 python -m pip install --upgrade pip
34- pip install meson
40+ pip install meson ninja
3541 - name : Install dependencies (ubuntu)
3642 if : matrix.os == 'ubuntu-latest'
3743 run : |
@@ -41,20 +47,54 @@ jobs:
4147 if : matrix.os == 'macos-latest'
4248 run : |
4349 brew install -q ninja nasm
50+ - name : Setup MSVC
51+ if : matrix.os == 'windows-latest'
52+ uses : ilammy/msvc-dev-cmd@v1
4453 - uses : actions/checkout@v6
45- - name : Build vmaf
54+ - name : Build vmaf (unix)
55+ if : matrix.os != 'windows-latest'
4656 run : |
4757 meson setup libvmaf libvmaf/build --buildtype release
58+ meson compile -C libvmaf/build
4859 sudo ninja -vC libvmaf/build install
49- - name : Prepare FFmpeg
60+ - name : Build vmaf (MSVC)
61+ if : matrix.os == 'windows-latest'
62+ run : |
63+ meson setup libvmaf libvmaf/build --buildtype release --default-library static --prefix "C:/vmaf"
64+ meson compile -C libvmaf/build
65+ meson install -C libvmaf/build
66+ - name : Add libvmaf to MSVC paths
67+ if : matrix.os == 'windows-latest'
68+ run : |
69+ echo "INCLUDE=C:/vmaf/include;$env:INCLUDE" >> $env:GITHUB_ENV
70+ echo "LIB=C:/vmaf/lib;$env:LIB" >> $env:GITHUB_ENV
71+ echo "PATH=C:/vmaf/bin;$env:PATH" >> $env:GITHUB_ENV
72+ - name : Prepare FFmpeg (autotools)
73+ if : matrix.ffmpeg_build == 'autotools'
5074 run : |
5175 git clone -q --branch master --depth=1 "https://github.com/FFmpeg/FFmpeg" ffmpeg
5276 cd ffmpeg
5377 ./configure --enable-version3 --enable-libvmaf --disable-indevs --cc="$CC" --cxx="$CXX" || { less ffbuild/config.log; exit 1; }
54- - name : Make FFmpeg
78+ - name : Make FFmpeg (autotools)
79+ if : matrix.ffmpeg_build == 'autotools'
5580 run : |
5681 sudo make -C ffmpeg --quiet -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) install
82+ - name : Clone FFmpeg Meson port
83+ if : matrix.ffmpeg_build == 'meson'
84+ run : |
85+ git clone --depth=1 https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git ffmpeg-meson
86+ - name : Configure FFmpeg (Meson)
87+ if : matrix.ffmpeg_build == 'meson'
88+ run : |
89+ cd ffmpeg-meson
90+ meson setup build --buildtype release -Dlibvmaf=enabled
91+ - name : Build FFmpeg (Meson)
92+ if : matrix.ffmpeg_build == 'meson'
93+ run : |
94+ meson compile -C ffmpeg-meson/build
95+ meson install -C ffmpeg-meson/build
5796 - name : Test ffmpeg
97+ if : matrix.ffmpeg_build == 'autotools'
5898 run : |
5999 curl "https://gist.githubusercontent.com/1480c1/0c4575da638ef6e8203feffd0597de16/raw/akiyo_cif.tar.xz.base64" | base64 -d | tar xJ
60100 vmaf_score=$(ffmpeg -hide_banner -nostats -i encoded.mkv -i orig.mkv -filter_complex libvmaf -f null - 2>&1 | grep 'VMAF score' | tr ' ' '\n' | tail -n1)
@@ -66,4 +106,17 @@ jobs:
66106 echo "vmaf score matches"
67107 exit 0
68108 fi
69- continue-on-error : true
109+ - name : Test ffmpeg (MSVC)
110+ if : matrix.ffmpeg_build == 'meson'
111+ run : |
112+ curl "https://gist.githubusercontent.com/1480c1/0c4575da638ef6e8203feffd0597de16/raw/akiyo_cif.tar.xz.base64" | base64 -d | tar xJ
113+ vmaf_score=$("C:/Program Files/ffmpeg/bin/ffmpeg.exe" -hide_banner -nostats -i encoded.mkv -i orig.mkv -filter_complex libvmaf -f null - 2>&1 | Select-String "VMAF score" | ForEach-Object { $_.ToString().Split()[-1] })
114+ echo $vmaf_score
115+ if ($vmaf_score -ne "93.663925") {
116+ echo "vmaf score doesn't match 93.663925"
117+ exit 1
118+ } else {
119+ echo "vmaf score matches"
120+ exit 0
121+ }
122+ continue-on-error : true
0 commit comments