https://github.com/OpenMW/openmw/commit/61cb5b4da638d520c41a9d99b5850384b2e22679

Index: extern/osg-ffmpeg-videoplayer/videostate.hpp
--- extern/osg-ffmpeg-videoplayer/videostate.hpp.orig
+++ extern/osg-ffmpeg-videoplayer/videostate.hpp
@@ -42,6 +42,9 @@ extern "C"
 
 #define VIDEO_PICTURE_QUEUE_SIZE 50
 
+#define FFMPEG_5_OR_GREATER (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100))
+#define FFMPEG_CONST_WRITEPACKET (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(60, 12, 100) && !defined(FF_API_AVIO_WRITE_NONCONST))
+
 extern "C"
 {
     struct SwsContext;
@@ -155,7 +158,13 @@ struct VideoState {
     double get_master_clock();
 
     static int istream_read(void *user_data, uint8_t *buf, int buf_size);
-    static int istream_write(void *user_data, uint8_t *buf, int buf_size);
+
+#if FFMPEG_CONST_WRITEPACKET
+    static int istream_write(void *, const unsigned char *, int);
+#else
+    static int istream_write(void *, uint8_t *, int);
+#endif
+
     static int64_t istream_seek(void *user_data, int64_t offset, int whence);
 
     osg::ref_ptr<osg::Texture2D> mTexture;
