forked from BtbN/FFmpeg-Builds
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
209 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Rebase on Upstream | ||
|
||
on: | ||
schedule: | ||
- cron: "00 16 * * *" # run every day an hour before regular build | ||
workflow_dispatch: # run manually | ||
|
||
jobs: | ||
rebase: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 | ||
- uses: siriume/rebase-upstream-action@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ On success, the resulting zip file will be in the `artifacts` subdir. | |
|
||
Available targets: | ||
* `win64` (x86_64 Windows) | ||
* `win32` (x86 Windows) | ||
* `linux64` (x86_64 Linux, glibc>=2.28, linux>=4.18) | ||
* `linuxarm64` (arm64 (aarch64) Linux, glibc>=2.28, linux>=4.18) | ||
|
||
|
@@ -58,11 +57,34 @@ Available variants: | |
* `gpl` Includes all dependencies, even those that require full GPL instead of just LGPL. | ||
* `lgpl` Lacking libraries that are GPL-only. Most prominently libx264 and libx265. | ||
* `nonfree` Includes fdk-aac in addition to all the dependencies of the gpl variant. | ||
* `gpl-shared` Same as gpl, but comes with the libav* family of shared libs instead of pure static executables. | ||
* `lgpl-shared` Same again, but with the lgpl set of dependencies. | ||
* `nonfree-shared` Same again, but with the nonfree set of dependencies. | ||
|
||
All of those can be optionally combined with any combination of addins: | ||
* `4.4`/`5.0`/`5.1`/`6.0`/`6.1`/`7.0` to build from the respective release branch instead of master. | ||
* `6.1`/`7.0`/`7.1` to build from the respective release branch instead of master. | ||
* `debug` to not strip debug symbols from the binaries. This increases the output size by about 250MB. | ||
* `lto` build all dependencies and ffmpeg with -flto=auto (HIGHLY EXPERIMENTAL, broken for Windows, sometimes works for Linux) | ||
|
||
|
||
## Patches Applied | ||
These patches have been applied to the builds: | ||
|
||
### 1. Decoding non-standard HEVC in FLV containers | ||
|
||
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). | ||
|
||
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. | ||
|
||
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]/). | ||
See [this comment](https://github.com/yt-dlp/yt-dlp/pull/5823#issuecomment-1366868753) for details. | ||
|
||
Fixes [yt-dlp#5874](https://github.com/yt-dlp/yt-dlp/issues/5874), [FFmpeg#6389](https://trac.ffmpeg.org/ticket/6389). | ||
|
||
## Credits | ||
|
||
* [@BtbN](https://github.com/BtbN) for the [original workflow](https://github.com/BtbN/FFmpeg-Builds) | ||
* [@nihil-admirari](https://github.com/nihil-admirari) for creating and maintaining this repo | ||
* [@yt-dlp](https://github.com/yt-dlp) for the [modified workflow](https://github.com/yt-dlp/FFmpeg-Builds) | ||
|
||
--- | ||
|
||
PS: The commits are unsigned because of the periodic [automatic rebase](https://github.com/yt-dlp/FFmpeg-Builds/actions/workflows/rebase-on-upstream.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
patches/ffmpeg/master/0001-Nonstandard-HEVC-over-FLV.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff --git a/libavformat/flv.h b/libavformat/flv.h | ||
index f710963..62297ed 100644 | ||
--- a/libavformat/flv.h | ||
+++ b/libavformat/flv.h | ||
@@ -116,6 +116,7 @@ enum { | ||
FLV_CODECID_H264 = 7, | ||
FLV_CODECID_REALH263= 8, | ||
FLV_CODECID_MPEG4 = 9, | ||
+ FLV_CODECID_HEVC = 12, | ||
}; | ||
|
||
enum { | ||
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c | ||
index 22a9b9e..dfbdaa6 100644 | ||
--- a/libavformat/flvdec.c | ||
+++ b/libavformat/flvdec.c | ||
@@ -335,6 +335,7 @@ static int flv_same_video_codec(AVCodecParameters *vpar, uint32_t flv_codecid) | ||
|
||
switch (flv_codecid) { | ||
case MKBETAG('h', 'v', 'c', '1'): | ||
+ case FLV_CODECID_HEVC: | ||
return vpar->codec_id == AV_CODEC_ID_HEVC; | ||
case MKBETAG('a', 'v', '0', '1'): | ||
return vpar->codec_id == AV_CODEC_ID_AV1; | ||
@@ -367,6 +368,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, | ||
|
||
switch (flv_codecid) { | ||
case MKBETAG('h', 'v', 'c', '1'): | ||
+ case FLV_CODECID_HEVC: | ||
par->codec_id = AV_CODEC_ID_HEVC; | ||
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; | ||
break; | ||
@@ -1463,7 +1465,7 @@ retry_duration: | ||
} | ||
|
||
if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || | ||
- (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) { | ||
+ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && (!enhanced_flv || type == PacketTypeCodedFrames))) { | ||
// sign extension | ||
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000; | ||
pts = av_sat_add64(dts, cts); |
41 changes: 41 additions & 0 deletions
41
patches/ffmpeg/release/7.0/0001-Nonstandard-HEVC-over-FLV.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff --git a/libavformat/flv.h b/libavformat/flv.h | ||
index f710963..62297ed 100644 | ||
--- a/libavformat/flv.h | ||
+++ b/libavformat/flv.h | ||
@@ -116,6 +116,7 @@ enum { | ||
FLV_CODECID_H264 = 7, | ||
FLV_CODECID_REALH263= 8, | ||
FLV_CODECID_MPEG4 = 9, | ||
+ FLV_CODECID_HEVC = 12, | ||
}; | ||
|
||
enum { | ||
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c | ||
index 22a9b9e..dfbdaa6 100644 | ||
--- a/libavformat/flvdec.c | ||
+++ b/libavformat/flvdec.c | ||
@@ -335,6 +335,7 @@ static int flv_same_video_codec(AVCodecParameters *vpar, uint32_t flv_codecid) | ||
|
||
switch (flv_codecid) { | ||
case MKBETAG('h', 'v', 'c', '1'): | ||
+ case FLV_CODECID_HEVC: | ||
return vpar->codec_id == AV_CODEC_ID_HEVC; | ||
case MKBETAG('a', 'v', '0', '1'): | ||
return vpar->codec_id == AV_CODEC_ID_AV1; | ||
@@ -367,6 +368,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, | ||
|
||
switch (flv_codecid) { | ||
case MKBETAG('h', 'v', 'c', '1'): | ||
+ case FLV_CODECID_HEVC: | ||
par->codec_id = AV_CODEC_ID_HEVC; | ||
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; | ||
break; | ||
@@ -1463,7 +1465,7 @@ retry_duration: | ||
} | ||
|
||
if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || | ||
- (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) { | ||
+ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && (!enhanced_flv || type == PacketTypeCodedFrames))) { | ||
// sign extension | ||
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000; | ||
pts = av_sat_add64(dts, cts); |
41 changes: 41 additions & 0 deletions
41
patches/ffmpeg/release/7.1/0001-Nonstandard-HEVC-over-FLV.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff --git a/libavformat/flv.h b/libavformat/flv.h | ||
index f710963..62297ed 100644 | ||
--- a/libavformat/flv.h | ||
+++ b/libavformat/flv.h | ||
@@ -116,6 +116,7 @@ enum { | ||
FLV_CODECID_H264 = 7, | ||
FLV_CODECID_REALH263= 8, | ||
FLV_CODECID_MPEG4 = 9, | ||
+ FLV_CODECID_HEVC = 12, | ||
}; | ||
|
||
enum { | ||
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c | ||
index 22a9b9e..dfbdaa6 100644 | ||
--- a/libavformat/flvdec.c | ||
+++ b/libavformat/flvdec.c | ||
@@ -335,6 +335,7 @@ static int flv_same_video_codec(AVCodecParameters *vpar, uint32_t flv_codecid) | ||
|
||
switch (flv_codecid) { | ||
case MKBETAG('h', 'v', 'c', '1'): | ||
+ case FLV_CODECID_HEVC: | ||
return vpar->codec_id == AV_CODEC_ID_HEVC; | ||
case MKBETAG('a', 'v', '0', '1'): | ||
return vpar->codec_id == AV_CODEC_ID_AV1; | ||
@@ -367,6 +368,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, | ||
|
||
switch (flv_codecid) { | ||
case MKBETAG('h', 'v', 'c', '1'): | ||
+ case FLV_CODECID_HEVC: | ||
par->codec_id = AV_CODEC_ID_HEVC; | ||
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; | ||
break; | ||
@@ -1463,7 +1465,7 @@ retry_duration: | ||
} | ||
|
||
if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || | ||
- (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) { | ||
+ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && (!enhanced_flv || type == PacketTypeCodedFrames))) { | ||
// sign extension | ||
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000; | ||
pts = av_sat_add64(dts, cts); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters