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 }}
@@ -28,33 +34,81 @@ jobs:
2834 uses : actions/setup-python@v6
2935 with :
3036 python-version : 3.11
37+
3138 - name : Install meson and ninja
3239 run : |
3340 python -m pip install --upgrade pip
34- pip install meson
41+ pip install meson ninja
42+
3543 - name : Install dependencies (ubuntu)
3644 if : matrix.os == 'ubuntu-latest'
3745 run : |
3846 sudo apt-get update
3947 sudo -E apt-get -yq install ninja-build gcc nasm
48+
4049 - name : Install dependencies (mac)
4150 if : matrix.os == 'macos-latest'
4251 run : |
4352 brew install -q ninja nasm
53+
54+ - name : Setup MSVC
55+ if : matrix.os == 'windows-latest'
56+ uses : ilammy/msvc-dev-cmd@v1
57+
4458 - uses : actions/checkout@v6
45- - name : Build vmaf
59+
60+ - name : Build vmaf (unix)
61+ if : matrix.os != 'windows-latest'
4662 run : |
4763 meson setup libvmaf libvmaf/build --buildtype release
64+ meson compile -C libvmaf/build
4865 sudo ninja -vC libvmaf/build install
49- - name : Prepare FFmpeg
66+
67+ - name : Build vmaf (MSVC)
68+ if : matrix.os == 'windows-latest'
69+ run : |
70+ meson setup libvmaf libvmaf/build --buildtype release --prefix "C:/vmaf"
71+ meson compile -C libvmaf/build
72+ meson install -C libvmaf/build
73+
74+ - name : Add libvmaf to MSVC paths
75+ if : matrix.os == 'windows-latest'
76+ run : |
77+ echo "INCLUDE=C:/vmaf/include;$env:INCLUDE" >> $env:GITHUB_ENV
78+ echo "LIB=C:/vmaf/lib;$env:LIB" >> $env:GITHUB_ENV
79+ echo "PATH=C:/vmaf/bin;$env:PATH" >> $env:GITHUB_ENV
80+
81+ - name : Prepare FFmpeg (autotools)
82+ if : matrix.ffmpeg_build == 'autotools'
5083 run : |
5184 git clone -q --branch master --depth=1 "https://github.com/FFmpeg/FFmpeg" ffmpeg
5285 cd ffmpeg
5386 ./configure --enable-version3 --enable-libvmaf --disable-indevs --cc="$CC" --cxx="$CXX" || { less ffbuild/config.log; exit 1; }
54- - name : Make FFmpeg
87+
88+ - name : Make FFmpeg (autotools)
89+ if : matrix.ffmpeg_build == 'autotools'
5590 run : |
5691 sudo make -C ffmpeg --quiet -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) install
92+
93+ - name : Clone FFmpeg Meson port
94+ if : matrix.ffmpeg_build == 'meson'
95+ run : |
96+ git clone --depth=1 https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git ffmpeg-meson
97+
98+ - name : Configure FFmpeg (Meson)
99+ if : matrix.ffmpeg_build == 'meson'
100+ run : |
101+ cd ffmpeg-meson
102+ meson setup build --buildtype release
103+
104+ - name : Build FFmpeg (Meson)
105+ if : matrix.ffmpeg_build == 'meson'
106+ run : |
107+ meson compile -C ffmpeg-meson/build
108+ meson install -C ffmpeg-meson/build
109+
57110 - name : Test ffmpeg
111+ if : matrix.ffmpeg_build == 'autotools'
58112 run : |
59113 curl "https://gist.githubusercontent.com/1480c1/0c4575da638ef6e8203feffd0597de16/raw/akiyo_cif.tar.xz.base64" | base64 -d | tar xJ
60114 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 +120,18 @@ jobs:
66120 echo "vmaf score matches"
67121 exit 0
68122 fi
69- continue-on-error : true
123+
124+ - name : Test ffmpeg (MSVC)
125+ if : matrix.ffmpeg_build == 'meson'
126+ run : |
127+ curl "https://gist.githubusercontent.com/1480c1/0c4575da638ef6e8203feffd0597de16/raw/akiyo_cif.tar.xz.base64" | base64 -d | tar xJ
128+ 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] })
129+ echo $vmaf_score
130+ if ($vmaf_score -ne "93.663925") {
131+ echo "vmaf score doesn't match 93.663925"
132+ exit 1
133+ } else {
134+ echo "vmaf score matches"
135+ exit 0
136+ }
137+ continue-on-error : true
0 commit comments