#include <sys/stat.h>
#include <libavformat/avformat.h>
#include <libavutil/mathematics.h>
+#if LIBAVCODEC_VERSION_MAJOR > 58
+#include <libavcodec/bsf.h>
+#include <libavcodec/avcodec.h>
+#endif
#include "tvheadend.h"
#include "streaming.h"
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;
{
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 -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},