Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit f66aaf6

Browse files
1480c1tianjunwork
authored andcommitted
Appveyor: Add ffmpeg build (#356)
Add ffmpeg builds to appveyor for testing windows mingw-w64 builds. Orignally had a msvc ffmpeg build, but is excluded since it takes a lot of time and can not easily be speed up. Signed-off-by: Christopher Degawa <[email protected]>
1 parent 9a2feb2 commit f66aaf6

File tree

2 files changed

+74
-37
lines changed

2 files changed

+74
-37
lines changed

.travis.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ script:
5252
cmake $TRAVIS_BUILD_DIR -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$build_type ${CMAKE_EFLAGS[@]}
5353
cmake -j $(if [ $TRAVIS_OS_NAME = osx ]; then sysctl -n hw.ncpu; else nproc; fi) --build . &&
5454
sudo cmake --build . --target install && cd $TRAVIS_BUILD_DIR
55-
- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -b test1.h265
55+
- travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -b test1.h265
5656
before_cache:
5757
- "sudo chown -R travis: $HOME/.ccache"
5858
matrix:
@@ -67,8 +67,8 @@ matrix:
6767
- os: osx
6868
compiler: gcc # gcc = clang in macOS, unecessary duplicate
6969
include:
70-
# valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./SvtHevcEncApp -help
71-
# Coding style check
70+
# valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./SvtHevcEncApp -help
71+
# Coding style check
7272
- name: Style check
7373
stage: style
7474
addons: skip
@@ -77,28 +77,28 @@ matrix:
7777
script:
7878
- git grep -InP --heading "\t|\r| $" -- . && IS_FAIL=true || true
7979
- git grep -I -l -z "" -- . | while IFS= read -r -d '' i; do
80-
if [ -n "$(tail -c 1 "$i")" ]; then
81-
echo "No newline at end of $i";
82-
IS_FAIL=true;
83-
fi;
80+
if [ -n "$(tail -c 1 "$i")" ]; then
81+
echo "No newline at end of $i";
82+
IS_FAIL=true;
83+
fi;
8484
done
8585
- git remote rm upstream 2> /dev/null || true
8686
- git remote add upstream https://github.com/OpenVisualCloud/SVT-HEVC.git
8787
- git fetch -q upstream master
8888
- for i in $(git rev-list HEAD ^upstream/master); do
89-
echo "Checking commit message of $i";
90-
msg="$(git log --format=%B -n 1 $i)";
91-
if [ -n "$(echo "$msg" | awk "NR==2")" ]; then
92-
echo "Malformed commit message in $i, second line must be empty";
93-
IS_FAIL=true;
94-
fi;
95-
if echo "$msg" | head -1 | grep -q '\.$'; then
96-
echo "Malformed commit message in $i, trailing period in subject line";
97-
IS_FAIL=true;
98-
fi;
89+
echo "Checking commit message of $i";
90+
msg="$(git log --format=%B -n 1 $i)";
91+
if [ -n "$(echo "$msg" | awk "NR==2")" ]; then
92+
echo "Malformed commit message in $i, second line must be empty";
93+
IS_FAIL=true;
94+
fi;
95+
if echo "$msg" | head -1 | grep -q '\.$'; then
96+
echo "Malformed commit message in $i, trailing period in subject line";
97+
IS_FAIL=true;
98+
fi;
9999
done
100100
- test -z "$IS_FAIL"
101-
# FFmpeg interation build
101+
# FFmpeg interation build
102102
- name: FFmpeg patch
103103
stage: test
104104
compiler: gcc
@@ -136,15 +136,15 @@ matrix:
136136
- mv -t $HOME akiyo_cif.y4m
137137
- *base_script
138138
- cd $HOME
139-
- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 120 -b test-pr-m9.h265
140-
- SvtHevcEncApp -encMode 0 -i akiyo_cif.y4m -n 3 -b test-pr-m0.h265
139+
- travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 120 -b test-pr-m9.h265
140+
- travis_wait SvtHevcEncApp -encMode 0 -i akiyo_cif.y4m -n 3 -b test-pr-m0.h265
141141
- rm -rf $TRAVIS_BUILD_DIR
142142
- git clone --depth 1 https://github.com/OpenVisualCloud/SVT-HEVC.git $TRAVIS_BUILD_DIR && cd $TRAVIS_BUILD_DIR
143143
- *base_script
144144
- mkdir -p $TRAVIS_BUILD_DIR/Build/linux/$build_type
145145
- cd $HOME
146-
- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 120 -b test-master-m9.h265
147-
- SvtHevcEncApp -encMode 0 -i akiyo_cif.y4m -n 3 -b test-master-m0.h265
146+
- travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 120 -b test-master-m9.h265
147+
- travis_wait SvtHevcEncApp -encMode 0 -i akiyo_cif.y4m -n 3 -b test-master-m0.h265
148148
- diff test-pr-m9.h265 test-master-m9.h265
149149
- diff test-pr-m0.h265 test-master-m0.h265
150150
- name: Coveralls Linux+gcc
@@ -155,7 +155,7 @@ matrix:
155155
script:
156156
- *base_script
157157
- &coveralls_script |
158-
SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -b test1.h265
158+
travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -b test1.h265
159159
git clone https://github.com/FFmpeg/FFmpeg ffmpeg --depth=1 --branch release/4.1
160160
cd ffmpeg
161161
git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch &&
@@ -166,7 +166,7 @@ matrix:
166166
sudo make install
167167
cd $TRAVIS_BUILD_DIR
168168
ffmpeg -i akiyo_cif.y4m -c:v libsvt_hevc test.h265
169-
SvtHevcEncApp -i stdin -w 352 -h 288 -fps 30 -n 150 -b test2.h265 < akiyo_cif.y4m
169+
travis_wait SvtHevcEncApp -i stdin -w 352 -h 288 -fps 30 -n 150 -b test2.h265 < akiyo_cif.y4m
170170
after_script: &after_coveralls_script |
171171
if [ $CC = "clang" ] && [ $TRAVIS_OS_NAME = linux ]; then
172172
GCOV_FILE=llvm-cov GCOV_OPTIONS='gcov -pl'
@@ -190,4 +190,4 @@ matrix:
190190
env: build_type=debug
191191
script:
192192
- *base_script
193-
- valgrind -- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 150 -b test1.h265
193+
- travis_wait valgrind -- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 150 -b test1.h265

appveyor.yml

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,29 @@ image: Visual Studio 2019
22
configuration:
33
- Debug
44
- Release
5+
- Release ffmpeg
56

67
environment:
8+
APPVEYOR_SAVE_CACHE_ON_ERROR: true
79
matrix:
810
- generator: Visual Studio 2019
911
CC: cl
10-
- generator: Ninja
11-
CC: gcc
12+
- generator: Unix Makefiles
13+
CC: ccache gcc
14+
15+
matrix:
16+
exclude:
17+
- configuration: Release ffmpeg
18+
generator: Visual Studio 2019
19+
1220
install:
1321
- '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64'
1422
- set "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
1523
- set MSYSTEM=MINGW64
1624
- set MSYS2_PATH_TYPE=inherit
1725
- bash -lc 'exit'
1826
- pacman -Syyuu --ask=20 --noconfirm --noprogressbar --needed
19-
- pacman -Sy --ask=20 --noconfirm --noprogressbar --needed mingw-w64-x86_64-yasm mingw-w64-x86_64-ccache mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja
27+
- pacman -Sy --ask=20 --noconfirm --noprogressbar --needed mingw-w64-x86_64-yasm mingw-w64-x86_64-ccache mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc pkg-config make
2028
- cd Build
2129
- ps: |
2230
if ($env:APPVEYOR_JOB_NAME -match "Debug") {
@@ -26,27 +34,56 @@ install:
2634
}
2735
if ("$env:generator" -match "Visual*") {
2836
if ("$env:generator" -match "2019") {
29-
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_C_COMPILER_LAUNCHER=ccache
37+
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=C:/msys2/mingw64 -DBUILD_SHARED_LIBS=off
3038
} else {
31-
cmake .. -G "$env:generator" -DCMAKE_C_COMPILER_LAUNCHER=ccache
39+
cmake .. -G "$env:generator" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=C:/msys2/mingw64 -DBUILD_SHARED_LIBS=off
3240
}
3341
} elseif ($null -ne $env:generator){
34-
cmake .. -G "$env:generator" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE="$configuration"
42+
cmake .. -G "$env:generator" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE="$configuration" -DCMAKE_INSTALL_PREFIX=C:/msys2/mingw64 -DBUILD_SHARED_LIBS=off
3543
} else {
36-
cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE="$configuration"
44+
cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE="$configuration" -DCMAKE_INSTALL_PREFIX=C:/msys2/mingw64 -DBUILD_SHARED_LIBS=off
3745
}
3846
- ccache -s
47+
- bash -lc 'ccache -s'
3948
- pacman -Sc --noconfirm
4049

4150
for:
4251
- matrix:
4352
only:
44-
- generator: Ninja
53+
- configuration: Release ffmpeg
54+
build_script:
55+
- if "%APPVEYOR_JOB_NAME:~0,5%"=="Debug" (set config=Debug) else set config=Release
56+
- if "%GENERATOR:~0,6%"=="Visual" set config=%config% -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
57+
- cmake --build . --config %config%
58+
- cmake --build . --target install
59+
- set "PKG_CONFIG_PATH=C:/msys2/mingw64/lib/pkgconfig"
60+
- pkg-config --debug --exists --print-errors SvtHevcEnc
61+
- git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
62+
- cd ffmpeg
63+
- curl -L https://raw.githubusercontent.com/OpenVisualCloud/SVT-HEVC/master/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch | patch --binary -sN -p1
64+
- ps: |
65+
$path = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine')
66+
$path = ($path.Split(';') | Where-Object { $_ -notmatch 'Git' }) -join ';'
67+
[System.Environment]::SetEnvironmentVariable('PATH', $path, 'Machine')
68+
- bash -c 'if test "$(echo $generator | cut -c1-6)" = "Visual"; then
69+
./configure --target-os=win64 --arch=x86_64 --toolchain=msvc --cc=cl --cxx=cl --extra-cflags="-MD" --disable-everything --enable-libsvthevc --enable-encoder=libsvt_hevc;
70+
else
71+
./configure --arch=x86_64 --cc="ccache gcc" --cxx="ccache g++" --enable-libsvthevc --enable-encoder=libsvt_hevc;
72+
fi || cat ffbuild/config.log'
73+
- make -j 10
74+
- ps: (New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/OpenVisualCloud/SVT-AV1-Resources/master/video.tar.gz', "$PWD\video.tar.gz")
75+
- tar xf video.tar.gz
76+
- ffmpeg -i akiyo_cif.y4m -c:v libsvt_hevc akiyo.h265
77+
- cd ..
78+
79+
- matrix:
80+
only:
81+
- generator: Unix Makefiles
4582
artifacts:
4683
- path: bin\Release\*.*
4784
name: $(APPVEYOR_PROJECT_NAME)_MINGW64
4885
build_script:
49-
- ninja -j10
86+
- make -j
5087
- matrix:
5188
only:
5289
- generator: Visual Studio 2019
@@ -57,15 +94,15 @@ for:
5794
name: $(APPVEYOR_PROJECT_NAME)_MSVC2019
5895

5996
test_script:
60-
- ps: cd ../Bin/$($env:APPVEYOR_JOB_NAME.Split(" ")[-1])
97+
- ps: if ($env:APPVEYOR_JOB_NAME -match "Debug") {cd ../Bin/Debug} else {cd ../Bin/Release}
6198
- ps: (New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/OpenVisualCloud/SVT-AV1-Resources/master/video.tar.gz', "$PWD\video.tar.gz")
62-
- 7z x -aoa video.tar.gz
63-
- 7z x -aoa video.tar
99+
- tar xf video.tar.gz
64100
- SvtHevcEncApp -n 50 -encMode 9 -i akiyo_cif.y4m -b test1.h265
65101
- del video.tar.gz video.tar akiyo_cif.y4m bus_cif.y4m test1.h265
66102

67103
cache:
68104
- 'C:\Users\appveyor\AppData\Roaming\.ccache'
105+
- 'C:\msys64\home\appveyor\.ccache'
69106
- 'C:\msys64\var\cache\pacman\pkg'
70107

71108
artifacts:

0 commit comments

Comments
 (0)