Skip to content

Commit e0e0002

Browse files
siriumegithub-actions[bot]
authored andcommitted
Modify build version.
1 parent 093f5e8 commit e0e0002

File tree

14 files changed

+209
-18
lines changed

14 files changed

+209
-18
lines changed

.github/workflows/build.yml

+24-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
default: false
1919
required: false
2020
schedule:
21-
- cron: '0 12 * * *'
21+
- cron: '00 17 * * *'
2222

2323
env:
2424
DOCKER_BUILDKIT: 1
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
- name: Repo Check
3333
run: |
34-
if [[ "$GITHUB_REPOSITORY" != "BtbN/FFmpeg-Builds" ]]; then
34+
if [[ "$GITHUB_REPOSITORY" != "siriume/FFmpeg-Builds" ]]; then
3535
echo "When forking this repository to make your own builds, you have to adjust this check."
3636
echo "When doing so make sure to randomize the scheduled cron time above, in order to spread out the various build times as much as possible."
3737
echo "This has been put in place due to the enormous amounts of traffic hundreds/thousands of parallel builds can cause on external infrastructure."
@@ -165,8 +165,17 @@ jobs:
165165
strategy:
166166
fail-fast: false
167167
matrix:
168-
target: [win64,linux64,linuxarm64]
169-
variant: [gpl,lgpl,gpl 5.1,gpl 6.1,gpl 7.1,lgpl 5.1,lgpl 6.1,lgpl 7.1,gpl-shared,lgpl-shared,gpl-shared 5.1,gpl-shared 6.1,gpl-shared 7.1,lgpl-shared 5.1,lgpl-shared 6.1,lgpl-shared 7.1]
168+
target: [win64,linux64]
169+
variant: [gpl,gpl 6.1,gpl 7.0,gpl 7.1,gpl-shared,gpl-shared 6.1,gpl-shared 7.0,gpl-shared 7.1]
170+
include:
171+
- target: linuxarm64
172+
variant: gpl
173+
- target: linuxarm64
174+
variant: gpl 7.1
175+
- target: linuxarm64
176+
variant: gpl-shared
177+
- target: linuxarm64
178+
variant: gpl-shared 7.1
170179
steps:
171180
- name: Free Disk-Space
172181
run: df -h && sudo apt-get clean && docker system prune -a -f && sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc && df -h
@@ -230,8 +239,17 @@ jobs:
230239
strategy:
231240
fail-fast: false
232241
matrix:
233-
target: [win64,linux64,linuxarm64]
234-
variant: [gpl,lgpl,gpl 5.1,gpl 6.1,gpl 7.1,lgpl 5.1,lgpl 6.1,lgpl 7.1,gpl-shared,lgpl-shared,gpl-shared 5.1,gpl-shared 6.1,gpl-shared 7.1,lgpl-shared 5.1,lgpl-shared 6.1,lgpl-shared 7.1]
242+
target: [win64,linux64]
243+
variant: [gpl,gpl 6.1,gpl 7.0,gpl 7.1,gpl-shared,gpl-shared 6.1,gpl-shared 7.0,gpl-shared 7.1]
244+
include:
245+
- target: linuxarm64
246+
variant: gpl
247+
- target: linuxarm64
248+
variant: gpl 7.1
249+
- target: linuxarm64
250+
variant: gpl-shared
251+
- target: linuxarm64
252+
variant: gpl-shared 7.1
235253
steps:
236254
- name: Free Disk-Space
237255
run: df -h && sudo apt-get clean && docker system prune -a -f && sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc && df -h

.github/workflows/pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
target: [win64,linux64,linuxarm64]
21-
variant: [lgpl,gpl 6.1,gpl 5.1,lgpl 6.1,lgpl 5.1,gpl-shared,lgpl-shared,gpl-shared 6.1,gpl-shared 5.1,lgpl-shared 6.1,lgpl-shared 5.1]
21+
variant: [gpl 6.1,gpl 5.1,gpl-shared,gpl-shared 6.1,gpl-shared 5.1]
2222
quickbuild: [1]
2323
include:
2424
- target: win64
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Rebase on Upstream
2+
3+
on:
4+
schedule:
5+
- cron: "00 16 * * *" # run every day an hour before regular build
6+
workflow_dispatch: # run manually
7+
8+
jobs:
9+
rebase:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
with:
14+
fetch-depth: 0
15+
- uses: siriume/rebase-upstream-action@master

README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ On success, the resulting zip file will be in the `artifacts` subdir.
4545

4646
Available targets:
4747
* `win64` (x86_64 Windows)
48-
* `win32` (x86 Windows)
4948
* `linux64` (x86_64 Linux, glibc>=2.28, linux>=4.18)
5049
* `linuxarm64` (arm64 (aarch64) Linux, glibc>=2.28, linux>=4.18)
5150

@@ -58,11 +57,34 @@ Available variants:
5857
* `gpl` Includes all dependencies, even those that require full GPL instead of just LGPL.
5958
* `lgpl` Lacking libraries that are GPL-only. Most prominently libx264 and libx265.
6059
* `nonfree` Includes fdk-aac in addition to all the dependencies of the gpl variant.
61-
* `gpl-shared` Same as gpl, but comes with the libav* family of shared libs instead of pure static executables.
62-
* `lgpl-shared` Same again, but with the lgpl set of dependencies.
6360
* `nonfree-shared` Same again, but with the nonfree set of dependencies.
6461

6562
All of those can be optionally combined with any combination of addins:
66-
* `4.4`/`5.0`/`5.1`/`6.0`/`6.1`/`7.0` to build from the respective release branch instead of master.
63+
* `6.1`/`7.0`/`7.1` to build from the respective release branch instead of master.
6764
* `debug` to not strip debug symbols from the binaries. This increases the output size by about 250MB.
6865
* `lto` build all dependencies and ffmpeg with -flto=auto (HIGHLY EXPERIMENTAL, broken for Windows, sometimes works for Linux)
66+
67+
68+
## Patches Applied
69+
These patches have been applied to the builds:
70+
71+
### 1. Decoding non-standard HEVC in FLV containers
72+
73+
HEVC inside FLV has been [standardized](https://github.com/veovera/enhanced-rtmp/blob/8c51d437e20a9199d92f24d9950b1216e07f065f/enhanced-rtmp.pdf) by [@Veovera](https://github.com/veovera), implemented by [@T-bagwell](https://github.com/T-bagwell) and merged to FFmpeg master in [aa83654](https://github.com/FFmpeg/FFmpeg/commit/aa83654d940e7599ee641fc5d0fcd10e7decf277) and [ac5cc66](https://github.com/FFmpeg/FFmpeg/commit/ac5cc66f9e4408c45c303f6bf482ff04d7cb355e).
74+
75+
Chinese sites seem to continue using an old non-standard way to deliver HEVC in FLV containers. These builds of FFmpeg support the decoding of such files.
76+
77+
Releases older than 6.1 also supported the encoding of such non-standard files. The implementation was assembled from patches by [@xiaoxial](https://github.com/VCDP/CDN/blob/master/FFmpeg_patches/0001-Add-SVT-HEVC-FLV-support-on-FFmpeg.patch), [@runner365](https://github.com/runner365/ffmpeg_rtmp_h265/blob/5.1/flvenc.c), and [Matthieu Patou](https://patchwork.ffmpeg.org/project/ffmpeg/patch/[email protected]/).
78+
See [this comment](https://github.com/yt-dlp/yt-dlp/pull/5823#issuecomment-1366868753) for details.
79+
80+
Fixes [yt-dlp#5874](https://github.com/yt-dlp/yt-dlp/issues/5874), [FFmpeg#6389](https://trac.ffmpeg.org/ticket/6389).
81+
82+
## Credits
83+
84+
* [@BtbN](https://github.com/BtbN) for the [original workflow](https://github.com/BtbN/FFmpeg-Builds)
85+
* [@nihil-admirari](https://github.com/nihil-admirari) for creating and maintaining this repo
86+
* [@yt-dlp](https://github.com/yt-dlp) for the [modified workflow](https://github.com/yt-dlp/FFmpeg-Builds)
87+
88+
---
89+
90+
PS: The commits are unsigned because of the periodic [automatic rebase](https://github.com/yt-dlp/FFmpeg-Builds/actions/workflows/rebase-on-upstream.yml)

build.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,25 @@ trap "rm -f -- '$BUILD_SCRIPT'" EXIT
2929

3030
cat <<EOF >"$BUILD_SCRIPT"
3131
set -xe
32+
shopt -s nullglob
3233
cd /ffbuild
3334
rm -rf ffmpeg prefix
3435
3536
git clone --filter=blob:none --branch='$GIT_BRANCH' '$FFMPEG_REPO' ffmpeg
3637
cd ffmpeg
3738
39+
git config user.email "builder@localhost"
40+
git config user.name "Builder"
41+
42+
PATCHES=('/patches/$GIT_BRANCH'/*.patch)
43+
if [[ "\${#PATCHES[@]}" = 0 ]]; then
44+
echo 'No patches found for $GIT_BRANCH'
45+
fi
46+
for patch in "\${PATCHES[@]}"; do
47+
echo "Applying \$patch"
48+
git apply "\$patch"
49+
done
50+
3851
./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS \$FF_CONFIGURE \
3952
--extra-cflags="\$FF_CFLAGS" --extra-cxxflags="\$FF_CXXFLAGS" --extra-libs="\$FF_LIBS" \
4053
--extra-ldflags="\$FF_LDFLAGS" --extra-ldexeflags="\$FF_LDEXEFLAGS" \
@@ -46,7 +59,7 @@ EOF
4659

4760
[[ -t 1 ]] && TTY_ARG="-t" || TTY_ARG=""
4861

49-
docker run --rm -i $TTY_ARG "${UIDARGS[@]}" -v "$PWD/ffbuild":/ffbuild -v "$BUILD_SCRIPT":/build.sh "$IMAGE" bash /build.sh
62+
docker run --rm -i $TTY_ARG "${UIDARGS[@]}" -v "$PWD/ffbuild":/ffbuild -v "$PWD/patches/ffmpeg/":/patches -v "$BUILD_SCRIPT":/build.sh "$IMAGE" bash /build.sh
5063

5164
mkdir -p artifacts
5265
ARTIFACTS_PATH="$PWD/artifacts"

images/base-linux64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds
1+
ARG GH_REPO=ghcr.io/siriume/ffmpeg-builds
22
FROM $GH_REPO/base:latest
33

44
RUN --mount=src=ct-ng-config,dst=/.config \

images/base-linuxarm64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds
1+
ARG GH_REPO=ghcr.io/siriume/ffmpeg-builds
22
FROM $GH_REPO/base:latest
33

44
RUN --mount=src=ct-ng-config,dst=/.config \

images/base-win32/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds
1+
ARG GH_REPO=ghcr.io/siriume/ffmpeg-builds
22
FROM $GH_REPO/base:latest
33

44
RUN --mount=src=ct-ng-config,dst=/.config \

images/base-win64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds
1+
ARG GH_REPO=ghcr.io/siriume/ffmpeg-builds
22
FROM $GH_REPO/base:latest
33

44
RUN --mount=src=ct-ng-config,dst=/.config \

images/base-winarm64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds
1+
ARG GH_REPO=ghcr.io/siriume/ffmpeg-builds
22
FROM $GH_REPO/base:latest
33

44
RUN \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/libavformat/flv.h b/libavformat/flv.h
2+
index f710963..62297ed 100644
3+
--- a/libavformat/flv.h
4+
+++ b/libavformat/flv.h
5+
@@ -116,6 +116,7 @@ enum {
6+
FLV_CODECID_H264 = 7,
7+
FLV_CODECID_REALH263= 8,
8+
FLV_CODECID_MPEG4 = 9,
9+
+ FLV_CODECID_HEVC = 12,
10+
};
11+
12+
enum {
13+
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
14+
index 22a9b9e..dfbdaa6 100644
15+
--- a/libavformat/flvdec.c
16+
+++ b/libavformat/flvdec.c
17+
@@ -335,6 +335,7 @@ static int flv_same_video_codec(AVCodecParameters *vpar, uint32_t flv_codecid)
18+
19+
switch (flv_codecid) {
20+
case MKBETAG('h', 'v', 'c', '1'):
21+
+ case FLV_CODECID_HEVC:
22+
return vpar->codec_id == AV_CODEC_ID_HEVC;
23+
case MKBETAG('a', 'v', '0', '1'):
24+
return vpar->codec_id == AV_CODEC_ID_AV1;
25+
@@ -367,6 +368,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
26+
27+
switch (flv_codecid) {
28+
case MKBETAG('h', 'v', 'c', '1'):
29+
+ case FLV_CODECID_HEVC:
30+
par->codec_id = AV_CODEC_ID_HEVC;
31+
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
32+
break;
33+
@@ -1463,7 +1465,7 @@ retry_duration:
34+
}
35+
36+
if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 ||
37+
- (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) {
38+
+ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && (!enhanced_flv || type == PacketTypeCodedFrames))) {
39+
// sign extension
40+
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;
41+
pts = av_sat_add64(dts, cts);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/libavformat/flv.h b/libavformat/flv.h
2+
index f710963..62297ed 100644
3+
--- a/libavformat/flv.h
4+
+++ b/libavformat/flv.h
5+
@@ -116,6 +116,7 @@ enum {
6+
FLV_CODECID_H264 = 7,
7+
FLV_CODECID_REALH263= 8,
8+
FLV_CODECID_MPEG4 = 9,
9+
+ FLV_CODECID_HEVC = 12,
10+
};
11+
12+
enum {
13+
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
14+
index 22a9b9e..dfbdaa6 100644
15+
--- a/libavformat/flvdec.c
16+
+++ b/libavformat/flvdec.c
17+
@@ -335,6 +335,7 @@ static int flv_same_video_codec(AVCodecParameters *vpar, uint32_t flv_codecid)
18+
19+
switch (flv_codecid) {
20+
case MKBETAG('h', 'v', 'c', '1'):
21+
+ case FLV_CODECID_HEVC:
22+
return vpar->codec_id == AV_CODEC_ID_HEVC;
23+
case MKBETAG('a', 'v', '0', '1'):
24+
return vpar->codec_id == AV_CODEC_ID_AV1;
25+
@@ -367,6 +368,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
26+
27+
switch (flv_codecid) {
28+
case MKBETAG('h', 'v', 'c', '1'):
29+
+ case FLV_CODECID_HEVC:
30+
par->codec_id = AV_CODEC_ID_HEVC;
31+
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
32+
break;
33+
@@ -1463,7 +1465,7 @@ retry_duration:
34+
}
35+
36+
if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 ||
37+
- (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) {
38+
+ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && (!enhanced_flv || type == PacketTypeCodedFrames))) {
39+
// sign extension
40+
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;
41+
pts = av_sat_add64(dts, cts);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/libavformat/flv.h b/libavformat/flv.h
2+
index f710963..62297ed 100644
3+
--- a/libavformat/flv.h
4+
+++ b/libavformat/flv.h
5+
@@ -116,6 +116,7 @@ enum {
6+
FLV_CODECID_H264 = 7,
7+
FLV_CODECID_REALH263= 8,
8+
FLV_CODECID_MPEG4 = 9,
9+
+ FLV_CODECID_HEVC = 12,
10+
};
11+
12+
enum {
13+
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
14+
index 22a9b9e..dfbdaa6 100644
15+
--- a/libavformat/flvdec.c
16+
+++ b/libavformat/flvdec.c
17+
@@ -335,6 +335,7 @@ static int flv_same_video_codec(AVCodecParameters *vpar, uint32_t flv_codecid)
18+
19+
switch (flv_codecid) {
20+
case MKBETAG('h', 'v', 'c', '1'):
21+
+ case FLV_CODECID_HEVC:
22+
return vpar->codec_id == AV_CODEC_ID_HEVC;
23+
case MKBETAG('a', 'v', '0', '1'):
24+
return vpar->codec_id == AV_CODEC_ID_AV1;
25+
@@ -367,6 +368,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
26+
27+
switch (flv_codecid) {
28+
case MKBETAG('h', 'v', 'c', '1'):
29+
+ case FLV_CODECID_HEVC:
30+
par->codec_id = AV_CODEC_ID_HEVC;
31+
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
32+
break;
33+
@@ -1463,7 +1465,7 @@ retry_duration:
34+
}
35+
36+
if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 ||
37+
- (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) {
38+
+ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && (!enhanced_flv || type == PacketTypeCodedFrames))) {
39+
// sign extension
40+
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;
41+
pts = av_sat_add64(dts, cts);

util/vars.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ while [[ "$#" -gt 0 ]]; do
3030
shift
3131
done
3232

33-
REPO="${GITHUB_REPOSITORY:-btbn/ffmpeg-builds}"
33+
REPO="${GITHUB_REPOSITORY:-siriume/ffmpeg-builds}"
3434
REPO="${REPO,,}"
3535
REGISTRY="${REGISTRY_OVERRIDE:-ghcr.io}"
3636
BASE_IMAGE="${REGISTRY}/${REPO}/base:latest"

0 commit comments

Comments
 (0)