Merge pull request #9739 from heitbaum/ffmpeg

Update Ffmpeg addon to 7.1 and tvheadend43 to latest
This commit is contained in:
Christian Hewitt 2025-01-31 18:50:56 +04:00 committed by GitHub
commit 7f9d4413a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 301 additions and 156 deletions

View File

@ -0,0 +1,293 @@
From 0a8ce55e9ec5bd805e868f7f342e86ec981a3441 Mon Sep 17 00:00:00 2001
From: phunkyfish <phunkyfish@gmail.com>
Date: Thu, 23 Jan 2025 09:01:35 +0000
Subject: [PATCH 1/5] Add configure~ to .gitignore
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 2941b0c..f463d0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ autom4te.cache
compile
config.*
configure
+configure~
depcomp
install-sh
missing
From d073c92190e14cbe79d6d2c6aae39a349b9c9a9f Mon Sep 17 00:00:00 2001
From: phunkyfish <phunkyfish@gmail.com>
Date: Wed, 22 Jan 2025 22:35:09 +0000
Subject: [PATCH 2/5] Enable building with ffmpeg 6 and 7
---
mpeg2dec.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/mpeg2dec.c b/mpeg2dec.c
index 3caa63c..4b13416 100755
--- a/mpeg2dec.c
+++ b/mpeg2dec.c
@@ -575,8 +575,14 @@ void sound_to_frames(VideoState *is, short **b, int s, int c, int format)
for (l=0;l < c;l++ ) volume += *((fb[l])++) * 64000;
else
for (l=0;l < c;l++ ) volume += *((fb[0])++) * 64000;
+#if LIBAVCODEC_BUILD >= AV_VERSION_INT(59, 37, 100) && \
+ LIBAVUTIL_BUILD >= AV_VERSION_INT(57, 28, 100)
+ *audio_buffer_ptr++ = volume / is->audio_st->codecpar->ch_layout.nb_channels;
+ avg_volume += abs(volume / is->audio_st->codecpar->ch_layout.nb_channels);
+#else
*audio_buffer_ptr++ = volume / is->audio_st->codecpar->channels;
avg_volume += abs(volume / is->audio_st->codecpar->channels);
+#endif
}
}
else
@@ -592,8 +598,14 @@ void sound_to_frames(VideoState *is, short **b, int s, int c, int format)
for (l=0;l < c;l++ ) volume += *((sb[l])++);
else
for (l=0;l < c;l++ ) volume += *((sb[0])++);
+#if LIBAVCODEC_BUILD >= AV_VERSION_INT(59, 37, 100) && \
+ LIBAVUTIL_BUILD >= AV_VERSION_INT(57, 28, 100)
+ *audio_buffer_ptr++ = volume / is->audio_st->codecpar->ch_layout.nb_channels;
+ avg_volume += abs(volume / is->audio_st->codecpar->ch_layout.nb_channels);
+#else
*audio_buffer_ptr++ = volume / is->audio_st->codecpar->channels;
avg_volume += abs(volume / is->audio_st->codecpar->channels);
+#endif
}
}
}
@@ -769,7 +781,19 @@ void audio_packet_process(VideoState *is, AVPacket *pkt)
}
-
+#if LIBAVCODEC_BUILD >= AV_VERSION_INT(59, 37, 100) && \
+ LIBAVUTIL_BUILD >= AV_VERSION_INT(57, 28, 100)
+ data_size = av_samples_get_buffer_size(NULL, is->frame->ch_layout.nb_channels,
+ is->frame->nb_samples,
+ is->frame->format, 1);
+ if (data_size > 0)
+ {
+ sound_to_frames(is, (short **)is->frame->data, is->frame->nb_samples ,is->frame->ch_layout.nb_channels, is->frame->format);
+ }
+ is->audio_clock += (double)data_size /
+ (is->frame->ch_layout.nb_channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
+ av_frame_unref(is->frame);
+#else
data_size = av_samples_get_buffer_size(NULL, is->frame->channels,
is->frame->nb_samples,
is->frame->format, 1);
@@ -780,6 +804,7 @@ void audio_packet_process(VideoState *is, AVPacket *pkt)
is->audio_clock += (double)data_size /
(is->frame->channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
av_frame_unref(is->frame);
+#endif
}
if (ALIGN_AC3_PACKETS && is->audio_st->codecpar->codec_id == AV_CODEC_ID_AC3) {
@@ -1033,6 +1058,10 @@ void DoSeekRequest(VideoState *is)
if(ret < 0)
{
char *error_text;
+#if LIBAVCODEC_BUILD >= AV_VERSION_INT(59, 37, 100) && \
+ LIBAVUTIL_BUILD >= AV_VERSION_INT(57, 28, 100)
+ error_text = "Generic";
+#else
if (is->pFormatCtx->iformat->read_seek)
{
error_text = "Format specific";
@@ -1045,6 +1074,7 @@ void DoSeekRequest(VideoState *is)
{
error_text = "Generic";
}
+#endif
fprintf(stderr, "%s error while seeking. target=%6.3f, \"%s\"\n", error_text,is->seek_pts, is->pFormatCtx->url);
From 22a3aeb6eb8d1d4fdadc4d19f61519282a32e643 Mon Sep 17 00:00:00 2001
From: phunkyfish <phunkyfish@gmail.com>
Date: Thu, 23 Jan 2025 16:28:44 +0000
Subject: [PATCH 3/5] Adding missing pthread header, needed for windows builds
---
comskip.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/comskip.c b/comskip.c
index 2babdb8..373bd53 100644
--- a/comskip.c
+++ b/comskip.c
@@ -16,6 +16,7 @@
#include "platform.h"
#include "vo.h"
#include <argtable2.h>
+#include <pthread.h>
#include <libavformat/avformat.h>
From 102b2a4e192f7d42681fc15c523b7863af7688a1 Mon Sep 17 00:00:00 2001
From: phunkyfish <phunkyfish@gmail.com>
Date: Thu, 23 Jan 2025 16:30:10 +0000
Subject: [PATCH 4/5] Fixes needed for windows build with Msys2
---
platform.h | 2 +-
video_out_dx.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/platform.h b/platform.h
index c37a872..179e89f 100644
--- a/platform.h
+++ b/platform.h
@@ -74,7 +74,7 @@ typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
-#ifndef HARDWARE_DECODE
+#if !defined(HARDWARE_DECODE) && !defined(__MINGW64__)
#include <compat/w32pthreads.h> // Is already defined in ffmpeg
#endif
diff --git a/video_out_dx.c b/video_out_dx.c
index 887df9b..ea17ab0 100644
--- a/video_out_dx.c
+++ b/video_out_dx.c
@@ -541,7 +541,7 @@ static int create_window (dx_instance_t * instance)
/* store a directx_instance pointer into the window local storage
* (for later use in event_handler).
* We need to use SetWindowLongPtr when it is available in mingw */
- SetWindowLongPtr (instance->window, GWLP_USERDATA, instance);
+ SetWindowLongPtr (instance->window, GWLP_USERDATA, (LONG_PTR) instance);
SetWindowPos(instance->window, HWND_TOP, 100, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE);
ShowWindow (instance->window, SW_SHOW);
@@ -928,13 +928,13 @@ void vo_init(int width, int height, char *title)
memset(buf2,128,width*height);
#ifdef RGB
- instance = vo_dxrgb_open();
- hWind = instance;
+ instance = (dx_instance_t *) vo_dxrgb_open();
+ hWind = (HWND) instance;
strcpy(instance->title, title);
dxrgb_setup( instance, width, height, width, height, &result);
// dx_setup_fbuf ( instance, buffer, &result);
#else
- instance = vo_dx_open();
+ instance = (HWND) vo_dx_open();
strcpy(instance->title, title);
dx_setup( instance, width, height, width, height, &result);
#endif
From cd5fce346cebc554d7e262a58c8961a6968243e8 Mon Sep 17 00:00:00 2001
From: phunkyfish <phunkyfish@gmail.com>
Date: Thu, 23 Jan 2025 08:44:06 +0000
Subject: [PATCH 5/5] Github workflows for Linux, Mac and Windows
---
.github/workflows/build.yaml | 87 ++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 .github/workflows/build.yaml
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 0000000..522b19c
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,87 @@
+name: Build
+on: [push, pull_request]
+
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-latest
+ platform: linux
+ - os: macos-latest
+ platform: macos
+ ffmpeg_version: ffmpeg5
+ - os: macos-latest
+ platform: macos
+ ffmpeg_version: ffmpeg6
+ - os: macos-latest
+ platform: macos
+ ffmpeg_version: ffmpeg7
+ - os: windows-latest
+ platform: windows-mingw
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup
+ shell: bash
+ run: |
+ setupScript='ci/${{ matrix.platform }}/setup.sh'
+ [ ! -f "$setupScript" ] || "$setupScript"
+
+ - name: Configure Apt packages
+ if: ${{ matrix.platform == 'linux' }}
+ run: |
+ sudo apt-get install -y autoconf libtool git build-essential libargtable2-dev libavformat-dev libswscale-dev libsdl1.2-dev
+
+ - name: Configure Brew packages ffmpeg7
+ if: ${{ matrix.ffmpeg_version == 'ffmpeg7' }}
+ run: |
+ brew install autoconf automake libtool pkgconfig argtable ffmpeg sdl
+
+ - name: Configure Brew packages ffmpeg6
+ if: ${{ matrix.ffmpeg_version == 'ffmpeg6' }}
+ run: |
+ brew install autoconf automake libtool pkgconfig argtable ffmpeg@6 sdl
+ brew link ffmpeg@6
+
+ - name: Configure Brew packages ffmpeg5
+ if: ${{ matrix.ffmpeg_version == 'ffmpeg5' }}
+ run: |
+ brew install autoconf automake libtool pkgconfig argtable ffmpeg@5 sdl
+ brew link ffmpeg@5
+
+ - name: Setup msys2
+ uses: msys2/setup-msys2@v2
+ if: ${{ matrix.platform == 'windows-mingw' }}
+ with:
+ update: true
+ install: >-
+ mingw-w64-x86_64-gcc
+ mingw-w64-x86_64-make
+ mingw-w64-x86_64-autotools
+ mingw-w64-x86_64-libtool
+ mingw-w64-x86_64-pkg-config
+ mingw-w64-x86_64-yasm
+ mingw-w64-x86_64-argtable
+ mingw-w64-x86_64-ffmpeg
+ - name: Put MSYS2_MinGW64 on PATH
+ if: ${{ matrix.platform == 'windows-mingw' }}
+ run: |
+ echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Configure and build Posix
+ if: ${{ matrix.platform != 'windows-mingw' }}
+ run: |
+ ./autogen.sh
+ ./configure
+ make
+
+ - name: Configure and build Windows
+ if: ${{ matrix.platform == 'windows-mingw' }}
+ run: |
+ msys2 -c './autogen.sh'
+ msys2 -c './configure'
+ msys2 -c 'make'

View File

@ -2,8 +2,8 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="ffmpegx"
PKG_VERSION="6.0.1"
PKG_SHA256="9b16b8731d78e596b4be0d720428ca42df642bb2d78342881ff7f5bc29fc9623"
PKG_VERSION="7.1"
PKG_SHA256="40973d44970dbc83ef302b0609f2e74982be2d85916dd2ee7472d30678a7abe6"
PKG_LICENSE="GPL-3.0-only"
PKG_SITE="https://ffmpeg.org"
PKG_URL="https://ffmpeg.org/releases/ffmpeg-${PKG_VERSION}.tar.xz"

View File

@ -1,52 +0,0 @@
From 0b541aa54b9573d8eef7401a0cc58c422fe60a9a Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Thu, 8 Aug 2024 18:04:17 +0100
Subject: [PATCH] libavcodec/arm/mlpdsp_armv5te: fix label format to work with
binutils 2.43
binutils 2.43 has stricter validation for labels[1] and results in errors
when building ffmpeg for armv5:
src/libavcodec/arm/mlpdsp_armv5te.S:232: Error: junk at end of line, first unrecognized character is `0'
Remove the leading zero in the "01" label to resolve this error.
[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b
Upstream-Status: Submitted [https://ffmpeg.org//pipermail/ffmpeg-devel/2024-August/332149.html]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
libavcodec/arm/mlpdsp_armv5te.S | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/arm/mlpdsp_armv5te.S b/libavcodec/arm/mlpdsp_armv5te.S
index 4f9aa48..d315686 100644
--- a/libavcodec/arm/mlpdsp_armv5te.S
+++ b/libavcodec/arm/mlpdsp_armv5te.S
@@ -229,7 +229,7 @@ A .endif
.endif
// Begin loop
-01:
+1:
.if TOTAL_TAPS == 0
// Things simplify a lot in this case
// In fact this could be pipelined further if it's worth it...
@@ -241,7 +241,7 @@ A .endif
str ST0, [PST, #-4]!
str ST0, [PST, #4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)]
str ST0, [PSAMP], #4 * MAX_CHANNELS
- bne 01b
+ bne 1b
.else
.if \fir_taps & 1
.set LOAD_REG, 1
@@ -333,7 +333,7 @@ T orr AC0, AC0, AC1
str ST3, [PST, #-4]!
str ST2, [PST, #4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)]
str ST3, [PSAMP], #4 * MAX_CHANNELS
- bne 01b
+ bne 1b
.endif
b 99f

View File

@ -1,96 +0,0 @@
From 1f801dfdb5066aadf0ade9cb5e94d620f33eacdc Mon Sep 17 00:00:00 2001
From: Gyan Doshi <ffmpeg@gyani.pro>
Date: Sun, 11 Aug 2024 12:51:50 +0530
Subject: [PATCH] lavc/libx265: unbreak build for X265_BUILD >= 210
x265 added support for alpha starting with build 210.
While doing so, x265_encoder_encode() changed its fifth arg to
an array of pointers to x265_picture. This broke building lavc/libx265.c
This patch simply unbreaks the build and maintains existing single-layer
non-alpha encoding support.
Fixes #11130
---
libavcodec/libx265.c | 40 ++++++++++++++++++++++++++++++----------
1 file changed, 30 insertions(+), 10 deletions(-)
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 0dc7ab6eeb6a3..3bc3b5a03e9fc 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -661,7 +661,13 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
{
libx265Context *ctx = avctx->priv_data;
x265_picture x265pic;
- x265_picture x265pic_out = { 0 };
+#if X265_BUILD >= 210
+ x265_picture x265pic_layers_out[MAX_SCALABLE_LAYERS];
+ x265_picture* x265pic_lyrptr_out[MAX_SCALABLE_LAYERS];
+#else
+ x265_picture x265pic_solo_out = { 0 };
+#endif
+ x265_picture* x265pic_out;
x265_nal *nal;
x265_sei *sei;
uint8_t *dst;
@@ -798,8 +804,16 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
#endif
}
+#if X265_BUILD >= 210
+ for (i = 0; i < MAX_SCALABLE_LAYERS; i++)
+ x265pic_lyrptr_out[i] = &x265pic_layers_out[i];
+
+ ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
+ pic ? &x265pic : NULL, x265pic_lyrptr_out);
+#else
ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
- pic ? &x265pic : NULL, &x265pic_out);
+ pic ? &x265pic : NULL, &x265pic_solo_out);
+#endif
for (i = 0; i < sei->numPayloads; i++)
av_free(sei->payloads[i].payload);
@@ -829,10 +843,16 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pkt->flags |= AV_PKT_FLAG_KEY;
}
- pkt->pts = x265pic_out.pts;
- pkt->dts = x265pic_out.dts;
+#if X265_BUILD >= 210
+ x265pic_out = x265pic_lyrptr_out[0];
+#else
+ x265pic_out = &x265pic_solo_out;
+#endif
+
+ pkt->pts = x265pic_out->pts;
+ pkt->dts = x265pic_out->dts;
- switch (x265pic_out.sliceType) {
+ switch (x265pic_out->sliceType) {
case X265_TYPE_IDR:
case X265_TYPE_I:
pict_type = AV_PICTURE_TYPE_I;
@@ -850,16 +870,16 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
#if X265_BUILD >= 130
- if (x265pic_out.sliceType == X265_TYPE_B)
+ if (x265pic_out->sliceType == X265_TYPE_B)
#else
- if (x265pic_out.frameData.sliceType == 'b')
+ if (x265pic_out->frameData.sliceType == 'b')
#endif
pkt->flags |= AV_PKT_FLAG_DISPOSABLE;
- ff_side_data_set_encoder_stats(pkt, x265pic_out.frameData.qp * FF_QP2LAMBDA, NULL, 0, pict_type);
+ ff_side_data_set_encoder_stats(pkt, x265pic_out->frameData.qp * FF_QP2LAMBDA, NULL, 0, pict_type);
- if (x265pic_out.userData) {
- int idx = (int)(intptr_t)x265pic_out.userData - 1;
+ if (x265pic_out->userData) {
+ int idx = (int)(intptr_t)x265pic_out->userData - 1;
ReorderedData *rd = &ctx->rd[idx];
pkt->duration = rd->duration;

View File

@ -4,7 +4,7 @@
PKG_NAME="nextpvr"
PKG_VERSION="7.0.1~Piers"
PKG_ADDON_VERSION="7.0.1~1"
PKG_REV="1"
PKG_REV="2"
PKG_ARCH="any"
PKG_LICENSE="NextPVR"
PKG_SITE="https://nextpvr.com"

View File

@ -5,7 +5,7 @@ PKG_NAME="tvheadend42"
PKG_VERSION="5bdcfd8ac97b3337e1c7911ae24127df76fa693a"
PKG_SHA256="b562a26248cdc02dc94cc62038deea172668fa4c079b2ea4e1b4220f3b1d34f5"
PKG_VERSION_NUMBER="4.2.8-36"
PKG_REV="4"
PKG_REV="5"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.tvheadend.org"

View File

@ -2,10 +2,10 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="tvheadend43"
PKG_VERSION="3dcb7ecf36666dcb43211a84141b1b645c9ca757"
PKG_SHA256="c7c8414bca5304276cc8f07aa291e36b50e1190d441f2af2ce256631b7c033c2"
PKG_VERSION="653bd0400b4413db96b80c807f0f7524f9248adb"
PKG_SHA256="9c2e13a70f97cf4c9b37cd93bfd03a7a1e0b7f3b18080c40ef99b8917642dbd7"
PKG_VERSION_NUMBER="4.3-2180"
PKG_REV="4"
PKG_REV="5"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.tvheadend.org"

View File

@ -3,7 +3,7 @@
PKG_NAME="ffmpeg-tools"
PKG_VERSION="1.0"
PKG_REV="3"
PKG_REV="4"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"