Skip to content

Commit 5a25203

Browse files
committed
Added libwebp,libvpx encoders.
Relocated .pc and .cmake prefixes. Split workflows
1 parent 48778c1 commit 5a25203

File tree

15 files changed

+562
-33
lines changed

15 files changed

+562
-33
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
env:
22
MSYS2_PATH_TYPE: inherit
33
SDK_VER: 10.0.22621.0
4-
TAG_NAME: ${{ inputs.tag_name||github.ref_name }}
4+
REF_NAME: ${{ inputs.ref_name||github.ref_name }}
55

66
name: Build
7-
run-name: Build ${{inputs.tag_name||github.ref_name}}
7+
run-name: Build ${{inputs.ref_name||github.ref_name}}
88

99
on:
1010
push:
1111
tags: "*"
12+
workflow_call:
13+
inputs:
14+
ref_name:
15+
description: "Tag"
16+
required: true
17+
type: string
1218
workflow_dispatch:
1319
inputs:
14-
tag_name:
20+
ref_name:
1521
description: "Tag"
1622
required: true
23+
type: string
1724

1825
jobs:
26+
prepare:
27+
uses: ./.github/workflows/cache.yml
28+
with:
29+
ref_name: ${{inputs.ref_name||github.ref_name}}
1930
build:
31+
needs: prepare
2032
strategy:
2133
matrix:
2234
arch: [x86, amd64, arm, arm64]
@@ -26,18 +38,34 @@ jobs:
2638
runs-on: windows-2022
2739
env:
2840
# amd64_arm,amd64_arm64,x86,amd64
29-
name: ffmpeg-${{ inputs.tag_name||github.ref_name }}-${{matrix.license}}-${{matrix.arch}}-${{matrix.type}}
41+
name: ffmpeg-${{ inputs.ref_name||github.ref_name }}-${{matrix.license}}-${{matrix.arch}}-${{matrix.type}}
3042
target: ${{contains(matrix.arch,'arm')&&format('amd64_{0}',matrix.arch)||matrix.arch}}
3143
steps:
32-
- name: Find MSVC
44+
- uses: actions/checkout@v4
45+
with:
46+
ref: ${{env.REF_NAME}}
47+
# submodules: recursive
48+
49+
- name: Setup Env
3350
shell: bash
34-
id: msvc
51+
id: setup
3552
run: |
3653
echo "installationPath=$(vswhere -all -legacy -property installationPath)">>$GITHUB_OUTPUT
37-
- uses: actions/checkout@v4
54+
# KEY=$(git ls-tree -r ${{env.REF_NAME}}|grep ^160000|sort -d|md5sum|cut -d' ' -f1)
55+
# echo "cache-key=$KEY" >>$GITHUB_OUTPUT
56+
57+
- name: Restore cached submodules
58+
id: cache-submodules-restore
59+
uses: actions/cache@v4
3860
with:
39-
ref: ${{env.TAG_NAME}}
40-
submodules: recursive
61+
path: .git/modules
62+
# key: ${{ runner.os }}-${{steps.setup.outputs.cache-key}}-submodules
63+
key: ${{ needs.prepare.outputs.cache-key }}
64+
65+
- name: Pull submodules
66+
shell: bash
67+
run: |
68+
git submodule update --init --recursive --depth 1
4169
4270
- uses: msys2/setup-msys2@v2
4371
with:
@@ -58,7 +86,7 @@ jobs:
5886
- name: Build
5987
shell: cmd
6088
run: |
61-
CALL "${{steps.msvc.outputs.installationPath}}\VC\Auxiliary\Build\vcvarsall.bat" ${{env.target}} ${{env.SDK_VER}}
89+
CALL "${{steps.setup.outputs.installationPath}}\VC\Auxiliary\Build\vcvarsall.bat" ${{env.target}} ${{env.SDK_VER}}
6290
msys2 -c "./build.sh ${{matrix.arch}} ${{matrix.type}} ${{matrix.license}}"
6391
6492
- name: Debug log
@@ -79,13 +107,14 @@ jobs:
79107
cd ${CWD}
80108
sha1sum ${{env.name}}.zip >${{env.name}}.sha1
81109
./build-changelog.sh > changelog
110+
82111
- name: Release
83112
if: ${{startsWith(github.ref, 'refs/tags/')}}
84113
uses: softprops/action-gh-release@v2
85114
with:
86-
tag_name: ${{env.TAG_NAME}}
115+
ref_name: ${{env.REF_NAME}}
87116
body_path: changelog
88-
prerelease: ${{contains(env.TAG_NAME,'dev')}}
117+
prerelease: ${{contains(env.REF_NAME,'dev')}}
89118
files: |
90119
${{env.name}}.zip
91120
${{env.name}}.sha1

.github/workflows/cache.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
env:
2+
REF_NAME: ${{ inputs.ref_name||github.ref_name }}
3+
4+
name: Cache
5+
run-name: Caching ${{inputs.ref_name||github.ref_name}}
6+
7+
on:
8+
workflow_call:
9+
inputs:
10+
ref_name:
11+
description: "Tag"
12+
required: false
13+
type: string
14+
outputs:
15+
cache-key:
16+
description: "Cache Key"
17+
value: ${{jobs.cache.outputs.cache-key}}
18+
jobs:
19+
cache:
20+
name: Cache ${{inputs.ref_name||github.ref_name}}
21+
outputs:
22+
cache-key: ${{steps.setup.outputs.cache-key}}
23+
runs-on: windows-2022
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: ${{env.REF_NAME}}
28+
29+
- name: Setup Env
30+
shell: bash
31+
id: setup
32+
run: |
33+
echo "installationPath=$(vswhere -all -legacy -property installationPath)">>$GITHUB_OUTPUT
34+
KEY=$(git ls-tree -r ${{env.REF_NAME}}|grep ^160000|sort -d|md5sum|cut -d' ' -f1)
35+
echo "cache-hash=$KEY" >>$GITHUB_OUTPUT
36+
echo "cache-key=${{ runner.os }}-$KEY-submodules" >>$GITHUB_OUTPUT
37+
38+
- name: Restore cached submodules
39+
id: cache-submodules-restore
40+
uses: actions/cache@v4
41+
with:
42+
path: .git/modules
43+
key: ${{steps.setup.outputs.cache-key}}
44+
45+
- name: Pull submodules
46+
shell: bash
47+
run: |
48+
git submodule update --init --recursive --depth 1

.github/workflows/check.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
git submodule update --init --depth 1 FFmpeg
2121
git -C FFmpeg fetch --tags
2222
git fetch --tags
23-
for tag_name in `git -C FFmpeg for-each-ref --sort=-taggerdate --format '%(refname:strip=2)' refs/tags |head -n 10`;do
24-
if git rev-parse "${tag_name}" >/dev/null 2>&1; then
25-
echo "skip '${tag_name}'"
23+
for ref_name in `git -C FFmpeg for-each-ref --sort=-taggerdate --format '%(refname:strip=2)' refs/tags |head -n 10`;do
24+
if git rev-parse "${ref_name}" >/dev/null 2>&1; then
25+
echo "skip '${ref_name}'"
2626
else
27-
echo "select '${tag_name}'"
28-
git -C FFmpeg checkout ${tag_name}
27+
echo "select '${ref_name}'"
28+
git -C FFmpeg checkout ${ref_name}
2929
git add FFmpeg
3030
31-
git commit -m "${tag_name}"
32-
git tag ${tag_name}
31+
git commit -m "${ref_name}"
32+
git tag ${ref_name}
3333
34-
git push origin ${tag_name}
34+
git push origin ${ref_name}
3535
fi
3636
done

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
env:
2+
MSYS2_PATH_TYPE: inherit
3+
SDK_VER: 10.0.22621.0
4+
REF_NAME: ${{ inputs.ref_name||github.ref_name }}
5+
6+
name: Test
7+
run-name: Test ${{inputs.ref_name||github.ref_name}}
8+
9+
on:
10+
push:
11+
workflow_dispatch:
12+
inputs:
13+
ref_name:
14+
description: "Tag"
15+
required: false
16+
17+
jobs:
18+
test:
19+
name: Test ${{inputs.ref_name||github.ref_name}}
20+
uses: ./.github/workflows/build.yml
21+
with:
22+
ref_name: ${{inputs.ref_name||github.ref_name}}

.gitmodules

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ url = https://github.com/madler/zlib.git
2626
path = openexr
2727
url = https://github.com/AcademySoftwareFoundation/openexr.git
2828
[submodule "x265_git"]
29-
path = x265_git
30-
url = https://bitbucket.org/multicoreware/x265_git.git
29+
path = x265_git
30+
url = https://bitbucket.org/multicoreware/x265_git.git
3131
[submodule "x264"]
32-
path = x264
33-
url = https://code.videolan.org/videolan/x264.git
32+
path = x264
33+
url = https://code.videolan.org/videolan/x264.git
34+
[submodule "libwebp"]
35+
path = libwebp
36+
url = https://github.com/webmproject/libwebp.git
37+
[submodule "libvpx"]
38+
path = libvpx
39+
url = https://github.com/webmproject/libvpx.git

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 System233
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ All builds include the following libraries:
6262
- [freetype](https://gitlab.freedesktop.org/freetype/freetype.git)
6363
- [harfbuzz](https://github.com/harfbuzz/harfbuzz.git)
6464
- [SDL2](https://github.com/libsdl-org/SDL.git)
65+
- [libvpx](https://github.com/webmproject/libvpx.git)
66+
- [libwebp](https://github.com/webmproject/libwebp.git)
6567
- [x264](https://code.videolan.org/videolan/x264.git) (GPL builds only)
6668
- [x265](https://bitbucket.org/multicoreware/x265_git.git) (GPL builds only)
6769

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ This release contains FFmpeg builds, compiled with MSVC (Microsoft Visual C++) v
1515
- [freetype](https://gitlab.freedesktop.org/freetype/freetype.git)
1616
- [harfbuzz](https://github.com/harfbuzz/harfbuzz.git)
1717
- [SDL2](https://github.com/libsdl-org/SDL.git)
18+
- [libvpx](https://github.com/webmproject/libvpx.git)
19+
- [libwebp](https://github.com/webmproject/libwebp.git)
1820
- [x264](https://code.videolan.org/videolan/x264.git) (GPL builds only)
1921
- [x265](https://bitbucket.org/multicoreware/x265_git.git) (GPL builds only)
2022

build-ffmpeg.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ shift 1
1111
cd $SRC_DIR
1212

1313
if [ $BUILD_TYPE == "static" ]; then
14-
CFLAGS="$CFLAGS /MT"
14+
CFLAGS="$CFLAGS -MT"
1515
TYPE_ARGS="--enable-static --pkg-config-flags=--static"
1616
else
17-
CFLAGS="$CFLAGS /MD"
17+
CFLAGS="$CFLAGS -MD"
1818
TYPE_ARGS="--enable-shared"
1919
fi
2020
if [[ $BUILD_ARCH =~ arm ]]; then
@@ -27,7 +27,7 @@ fi
2727
CFLAGS="$CFLAGS -I${SRC_DIR}/compat/stdbit"
2828
EX_BUILD_ARGS="$TYPE_ARGS $CROSS_ARGS $LICENSE_ARGS"
2929

30-
./configure --toolchain=msvc --arch=$BUILD_ARCH $EX_BUILD_ARGS $@
31-
iconv -f gbk config.h >config.h.tmp && mv config.h.tmp config.h
30+
CFLAGS="$CFLAGS" ./configure --toolchain=msvc --arch=$BUILD_ARCH $EX_BUILD_ARGS $@
31+
# iconv -f gbk config.h >config.h.tmp && mv config.h.tmp config.h
3232
make -j$(nproc)
3333
make install prefix=$INSTALL_PREFIX

0 commit comments

Comments
 (0)