Backport https://github.com/mltframework/mlt/commit/ae83ceee72a0a39c063b02310f6ce928839712a2

Index: src/modules/avformat/common.c
--- src/modules/avformat/common.c.orig
+++ src/modules/avformat/common.c
@@ -367,10 +367,20 @@ void mlt_image_to_avframe(mlt_image image, mlt_frame m
     avframe->height = image->height;
     avframe->format = mlt_to_av_image_format(image->format);
     avframe->sample_aspect_ratio = av_d2q(mlt_frame_get_aspect_ratio(mltframe), 1024);
-    ;
     avframe->pts = mlt_frame_get_position(mltframe);
+#if LIBAVUTIL_VERSION_INT >= ((58 << 16) + (7 << 8) + 100)
+    if (!mlt_properties_get_int(frame_properties, "progressive"))
+        avframe->flags |= AV_FRAME_FLAG_INTERLACED;
+    else
+        avframe->flags &= ~AV_FRAME_FLAG_INTERLACED;
+    if (mlt_properties_get_int(frame_properties, "top_field_first"))
+        avframe->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
+    else
+        avframe->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
+#else
     avframe->interlaced_frame = !mlt_properties_get_int(frame_properties, "progressive");
     avframe->top_field_first = mlt_properties_get_int(frame_properties, "top_field_first");
+#endif
     avframe->color_primaries = mlt_properties_get_int(frame_properties, "color_primaries");
     avframe->color_trc = mlt_properties_get_int(frame_properties, "color_trc");
     avframe->color_range = mlt_properties_get_int(frame_properties, "full_range")
