https://github.com/dirkvdb/ffmpegthumbnailer/pull/240

Index: libffmpegthumbnailer/moviedecoder.cpp
--- libffmpegthumbnailer/moviedecoder.cpp.orig
+++ libffmpegthumbnailer/moviedecoder.cpp
@@ -406,7 +406,7 @@ void MovieDecoder::initializeFilterGraph(const AVRatio
             "Failed to create filter sink");
 
     AVFilterContext* yadifFilter = nullptr;
-    if (m_pFrame->interlaced_frame != 0)
+    if (m_pFrame->flags & AV_FRAME_FLAG_INTERLACED)
     {
         checkRc(avfilter_graph_create_filter(&yadifFilter, avfilter_get_by_name("yadif"), "thumb_deint", "deint=1", nullptr, m_pFilterGraph),
                 "Failed to create deinterlace filter");
@@ -518,7 +518,7 @@ void MovieDecoder::seek(int timeInSeconds)
         }
 
         ++keyFrameAttempts;
-    } while ((!gotFrame || !m_pFrame->key_frame) && keyFrameAttempts < 200);
+    } while ((!gotFrame || !(m_pFrame->flags & AV_FRAME_FLAG_KEY)) && keyFrameAttempts < 200); 
 
     if (gotFrame == 0)
     {
@@ -655,20 +655,27 @@ void MovieDecoder::checkRc(int ret, const std::string&
 
 int32_t MovieDecoder::getStreamRotation()
 {
-    auto matrix = reinterpret_cast<int32_t*>(av_stream_get_side_data(m_pVideoStream, AV_PKT_DATA_DISPLAYMATRIX, nullptr));
-    if (matrix)
-    {
+    if (!m_pVideoStream || !m_pVideoStream->codecpar) {
+        return -1;
+    }
+
+    // For FFmpeg 5.0+
+    const AVPacketSideData* side_data = av_packet_side_data_get(
+        m_pVideoStream->codecpar->coded_side_data,
+        m_pVideoStream->codecpar->nb_coded_side_data,
+        AV_PKT_DATA_DISPLAYMATRIX
+    );
+
+    if (side_data && side_data->size >= sizeof(int32_t) * 9) {
+        const int32_t* matrix = reinterpret_cast<const int32_t*>(side_data->data);
         auto angle = lround(av_display_rotation_get(matrix));
-        if (angle < -135)
-        {
+        if (angle < -135) {
             return 3;
         }
-        else if (angle > 45 && angle < 135)
-        {
+        else if (angle > 45 && angle < 135) {
             return 2;
         }
-        else if (angle < -45 && angle > -135)
-        {
+        else if (angle < -45 && angle > -135) {
             return 1;
         }
     }
