https://build.opensuse.org/projects/openSUSE:Factory/packages/mediastreamer2/files/fix-build-ffmpeg5.patch

Index: src/utils/ffmpeg-priv.h
--- src/utils/ffmpeg-priv.h.orig
+++ src/utils/ffmpeg-priv.h
@@ -76,6 +76,29 @@ static inline int
 avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) {
 	return avcodec_decode_video(avctx, picture, got_picture_ptr, avpkt->data, avpkt->size);
 }
+#else
+static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
+{
+    int ret;
+
+    *got_frame = 0;
+
+    if (pkt) {
+        ret = avcodec_send_packet(avctx, pkt);
+        // In particular, we don't expect AVERROR(EAGAIN), because we read all
+        // decoded frames with avcodec_receive_frame() until done.
+        if (ret < 0)
+            return ret == AVERROR_EOF ? 0 : ret;
+    }
+
+    ret = avcodec_receive_frame(avctx, frame);
+    if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
+        return ret;
+    if (ret >= 0)
+        *got_frame = 1;
+
+    return 0;
+}
 #endif
 #if HAVE_AVCODEC_OLD_CODEC_IDS
 #include <libavcodec/old_codec_ids.h>
@@ -114,11 +137,6 @@ extern "C" {
 
 #ifndef HAVE_FUN_avcodec_encode_video2
 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
-#endif
-
-#ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
-int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
-AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
 #endif
 
 #ifndef HAVE_FUN_avcodec_open2 /**/
