From: alingherghescu Date: Sun, 2 Apr 2023 18:38:35 +0000 (-0700) Subject: update to ffmpeg 5.1.2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f32c7c59a19a276648d7b068041738e4e8337638;p=thirdparty%2Ftvheadend.git update to ffmpeg 5.1.2 - ffmpeg_static will always compile with ffmpeg 5.1.2 - Makefile.ffmpeg added to 5.1.2 - src/muxer/muxer_libav.c: update 'AVOutputFrmat' to 'const AVOutputFrmat' - src/transcoding/transcode/hwaccels/vaapi.c --> incorporated the struct from libavcodec/vaapi.h - src/transcoding/transcode/video.c: update type for qdata_size --- diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg index 25f956e83..3763bff01 100644 --- a/Makefile.ffmpeg +++ b/Makefile.ffmpeg @@ -108,10 +108,10 @@ FFNVCODEC_TB = $(FFNVCODEC).tar.gz FFNVCODEC_URL = https://github.com/FFmpeg/nv-codec-headers/releases/download/n$(FFNVCODEC_VER)/nv-codec-headers-$(FFNVCODEC_VER).tar.gz FFNVCODEC_SHA1 = 89bee0d3025b813c513084ad8546b0261623fbb0 -FFMPEG = ffmpeg-4.4.3 +FFMPEG = ffmpeg-5.1.2 FFMPEG_TB = $(FFMPEG).tar.bz2 FFMPEG_URL = https://ffmpeg.org/releases/$(FFMPEG_TB) -FFMPEG_SHA1 = a900f77ed16a18421983b499114c1595b8b765f2 +FFMPEG_SHA1 = f5215c15ca50a43856f641c714c6070aa148dd66 # ############################################################################## diff --git a/src/input/mpegts/iptv/iptv_libav.c b/src/input/mpegts/iptv/iptv_libav.c index 8e3288727..bdba7d600 100644 --- a/src/input/mpegts/iptv/iptv_libav.c +++ b/src/input/mpegts/iptv/iptv_libav.c @@ -24,6 +24,10 @@ #include #include +#if LIBAVCODEC_VERSION_MAJOR > 58 +#include +#endif + #define WRITE_BUFFER_SIZE (188*500) typedef struct { diff --git a/src/muxer/muxer_libav.c b/src/muxer/muxer_libav.c index 9650a1816..c7a190e78 100644 --- a/src/muxer/muxer_libav.c +++ b/src/muxer/muxer_libav.c @@ -21,6 +21,10 @@ #include #include #include +#if LIBAVCODEC_VERSION_MAJOR > 58 +#include +#include +#endif #include "tvheadend.h" #include "streaming.h" @@ -343,7 +347,11 @@ lav_muxer_init(muxer_t* m, struct streaming_start *ss, const char *name) AVDictionary *opts = NULL; lav_muxer_t *lm = (lav_muxer_t*)m; char app[128]; +#if LIBAVCODEC_VERSION_MAJOR > 58 + const AVOutputFormat *fmt; +#else AVOutputFormat *fmt; +#endif const char *muxer_name; int rc = -1; @@ -690,7 +698,11 @@ lav_muxer_create(const muxer_config_t *m_cfg, { const char *mux_name; lav_muxer_t *lm; +#if LIBAVCODEC_VERSION_MAJOR > 58 + const AVOutputFormat *fmt; +#else AVOutputFormat *fmt; +#endif switch(m_cfg->m_type) { case MC_MPEGPS: diff --git a/src/transcoding/transcode/video.c b/src/transcoding/transcode/video.c index 163bc2f42..6a98784da 100644 --- a/src/transcoding/transcode/video.c +++ b/src/transcoding/transcode/video.c @@ -17,7 +17,6 @@ * along with this program. If not, see . */ - #include "internals.h" #if ENABLE_HWACCELS @@ -343,7 +342,12 @@ static int tvh_video_context_wrap(TVHContext *self, AVPacket *avpkt, th_pkt_t *pkt) { uint8_t *qsdata = NULL; +#if LIBAVCODEC_VERSION_MAJOR < 59 int qsdata_size = 0; +#else + size_t qsdata_size = 0; +#endif + enum AVPictureType pict_type = AV_PICTURE_TYPE_NONE; if (avpkt->flags & AV_PKT_FLAG_KEY) { diff --git a/support/patches/ffmpeg.libx264.diff b/support/patches/ffmpeg.libx264.diff index 5e28ee409..4c46de626 100644 --- a/support/patches/ffmpeg.libx264.diff +++ b/support/patches/ffmpeg.libx264.diff @@ -1,12 +1,12 @@ -diff -urN ../ffmpeg-3.1.2.orig/libavcodec/libx264.c ./libavcodec/libx264.c ---- ../ffmpeg-3.1.2.orig/libavcodec/libx264.c 2016-08-09 00:53:26.000000000 +0200 -+++ ./libavcodec/libx264.c 2016-08-22 07:46:36.641867975 +0200 -@@ -902,7 +902,7 @@ +diff -urN ../ffmpeg-5.1.2.orig/libavcodec/libx264.c ./libavcodec/libx264.c +--- ../ffmpeg-5.1.2.orig/libavcodec/libx264.c 2023-04-03 00:53:26.000000000 +0200 ++++ ./libavcodec/libx264.c 2023-04-03 07:46:36.641867975 +0200 +@@ -1100,7 +1100,7 @@ static const AVOption options[] = { { "preset", "Set the encoding preset (cf. x264 --fullhelp)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE}, { "tune", "Tune the encoding params (cf. x264 --fullhelp)", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, -- { "profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, -+ { "x264profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, +- { "profile", "Set profile restrictions (cf. x264 --fullhelp)", OFFSET(profile_opt), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, ++ { "x264profile", "Set profile restrictions (cf. x264 --fullhelp)", OFFSET(profile_opt), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, { "fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE}, {"level", "Specify level (as defined by Annex A)", OFFSET(level), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, {"passlogfile", "Filename for 2 pass stats", OFFSET(stats), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},