Skip to content

Commit 61356c5

Browse files
committed
CI: Add build and test FFmpeg-libvmaf on MSVC
1 parent a861995 commit 61356c5

1 file changed

Lines changed: 58 additions & 4 deletions

File tree

.github/workflows/ffmpeg.yml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- os: macos-latest
2020
CC: clang
2121
CXX: clang++
22+
- os: windows-latest
23+
CC: cl
24+
CXX: cl
2225
runs-on: ${{ matrix.os }}
2326
env:
2427
CC: ${{ matrix.CC }}
@@ -29,6 +32,7 @@ jobs:
2932
with:
3033
python-version: 3.11
3134
- name: Install meson and ninja
35+
if: matrix.os != 'windows-latest'
3236
run: |
3337
python -m pip install --upgrade pip
3438
pip install meson
@@ -41,20 +45,52 @@ jobs:
4145
if: matrix.os == 'macos-latest'
4246
run: |
4347
brew install -q ninja nasm
48+
- name: Install dependencies (windows)
49+
if: matrix.os == 'windows-latest'
50+
run: |
51+
choco install -y ninja nasm meson pkgconfiglite
52+
- name: Setup MSVC
53+
if: matrix.os == 'windows-latest'
54+
uses: ilammy/msvc-dev-cmd@v1
4455
- uses: actions/checkout@v6
4556
- name: Build vmaf
4657
run: |
4758
meson setup libvmaf libvmaf/build --buildtype release
48-
sudo ninja -vC libvmaf/build install
49-
- name: Prepare FFmpeg
59+
meson install -C libvmaf/build
60+
- name: Prepare static libs for MSVC
61+
if: matrix.os == 'windows-latest'
62+
shell: pwsh
63+
run: |
64+
Rename-Item -Path C:\vmaf\lib\libpthreadVC3.a -NewName C:\vmaf\lib\pthreadVC3.lib
65+
Rename-Item -Path C:\vmaf\lib\libpthreadVCE3.a -NewName C:\vmaf\lib\pthreadVCE3.lib
66+
Rename-Item -Path C:\vmaf\lib\libpthreadVSE3.a -NewName C:\vmaf\lib\pthreadVSE3.lib
67+
Rename-Item -Path C:\vmaf\lib\libvmaf.a -NewName C:\vmaf\lib\vmaf.lib
68+
echo "INCLUDE=C:/vmaf/include;$env:INCLUDE" >> $env:GITHUB_ENV
69+
echo "LIB=C:/vmaf/lib;$env:LIB" >> $env:GITHUB_ENV
70+
echo "PATH=C:/vmaf/bin;$env:PATH" >> $env:GITHUB_ENV
71+
echo "PKG_CONFIG_PATH=C:/vmaf/lib/pkgconfig;$env:PKG_CONFIG_PATH" >> $env:GITHUB_ENV
72+
- name: Prepare FFmpeg (unix)
73+
if: matrix.os != 'windows-latest'
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: Prepare FFmpeg (windows)
79+
if: matrix.os == 'windows-latest'
80+
run: |
81+
git clone --depth=1 https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git ffmpeg
82+
cd ffmpeg
83+
meson setup build --buildtype release -Dlibvmaf=enabled -Dprograms=enabled --prefix "C:/ffmpeg"
84+
- name: Make FFmpeg (unix)
85+
if: matrix.os != 'windows-latest'
5586
run: |
5687
sudo make -C ffmpeg --quiet -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) install
57-
- name: Test ffmpeg
88+
- name: Make FFmpeg (windows)
89+
if: matrix.os == 'windows-latest'
90+
run: |
91+
meson install -C ffmpeg/build
92+
- name: Test ffmpeg (unix)
93+
if: matrix.os != 'windows-latest'
5894
run: |
5995
curl "https://gist.githubusercontent.com/1480c1/0c4575da638ef6e8203feffd0597de16/raw/akiyo_cif.tar.xz.base64" | base64 -d | tar xJ
6096
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)
@@ -67,3 +103,21 @@ jobs:
67103
exit 0
68104
fi
69105
continue-on-error: true
106+
- name: Test ffmpeg (MSVC)
107+
if: matrix.os == 'windows-latest'
108+
shell: pwsh
109+
run: |
110+
curl "https://gist.githubusercontent.com/1480c1/0c4575da638ef6e8203feffd0597de16/raw/akiyo_cif.tar.xz.base64" | base64 -d | tar xJ
111+
$ffmpeg = "C:/ffmpeg/bin/ffmpeg.exe"
112+
$vmaf_score = (& $ffmpeg -hide_banner -nostats -i encoded.mkv -i orig.mkv -filter_complex libvmaf -f null - 2>&1 |
113+
Select-String "VMAF score" |
114+
ForEach-Object { $_.ToString().Split()[-1] }).Trim()
115+
echo "VMAF score: $vmaf_score"
116+
if ($vmaf_score -ne "93.663925") {
117+
echo "vmaf score doesn't match 93.663925"
118+
exit 1
119+
} else {
120+
echo "vmaf score matches"
121+
exit 0
122+
}
123+
continue-on-error: true

0 commit comments

Comments
 (0)