Index: libhb/encavcodec.c
--- libhb/encavcodec.c.orig
+++ libhb/encavcodec.c
@@ -333,7 +333,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * j
     if ((job->vcodec == HB_VCODEC_FFMPEG_VCE_H264) || (job->vcodec == HB_VCODEC_FFMPEG_VCE_H265) || (job->vcodec == HB_VCODEC_FFMPEG_VCE_H265_10BIT))
     {
         // Set encoder preset
-        context->profile = FF_PROFILE_UNKNOWN;
+        context->profile = AV_PROFILE_UNKNOWN;
         if (job->encoder_preset != NULL && *job->encoder_preset)
         {
             if ((!strcasecmp(job->encoder_preset, "balanced"))
@@ -915,17 +915,17 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * j
     if (job->vcodec == HB_VCODEC_FFMPEG_VCE_H264)
     {
         // Set profile and level
-        context->profile = FF_PROFILE_UNKNOWN;
+        context->profile = AV_PROFILE_UNKNOWN;
         if (job->encoder_profile != NULL && *job->encoder_profile)
         {
             if (!strcasecmp(job->encoder_profile, "baseline"))
-                context->profile = FF_PROFILE_H264_BASELINE;
+                context->profile = AV_PROFILE_H264_BASELINE;
             else if (!strcasecmp(job->encoder_profile, "main"))
-                 context->profile = FF_PROFILE_H264_MAIN;
+                 context->profile = AV_PROFILE_H264_MAIN;
             else if (!strcasecmp(job->encoder_profile, "high"))
-                context->profile = FF_PROFILE_H264_HIGH;
+                context->profile = AV_PROFILE_H264_HIGH;
         }
-        context->level = FF_LEVEL_UNKNOWN;
+        context->level = AV_LEVEL_UNKNOWN;
         if (job->encoder_level != NULL && *job->encoder_level)
         {
             int i = 1;
@@ -941,13 +941,13 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * j
     if (job->vcodec == HB_VCODEC_FFMPEG_VCE_H265 || job->vcodec == HB_VCODEC_FFMPEG_VCE_H265_10BIT)
     {
         // Set profile and level
-        context->profile = FF_PROFILE_UNKNOWN;
+        context->profile = AV_PROFILE_UNKNOWN;
         if (job->encoder_profile != NULL && *job->encoder_profile)
         {
             if (!strcasecmp(job->encoder_profile, "main"))
-                 context->profile = FF_PROFILE_HEVC_MAIN;
+                 context->profile = AV_PROFILE_HEVC_MAIN;
         }
-        context->level = FF_LEVEL_UNKNOWN;
+        context->level = AV_LEVEL_UNKNOWN;
         if (job->encoder_level != NULL && *job->encoder_level)
         {
             int i = 1;
@@ -1000,15 +1000,15 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * j
 
     if (job->vcodec == HB_VCODEC_FFMPEG_MF_H264)
     {
-        context->profile = FF_PROFILE_UNKNOWN;
+        context->profile = AV_PROFILE_UNKNOWN;
         if (job->encoder_profile != NULL && *job->encoder_profile)
         {
             if (!strcasecmp(job->encoder_profile, "baseline"))
-                context->profile = FF_PROFILE_H264_BASELINE;
+                context->profile = AV_PROFILE_H264_BASELINE;
             else if (!strcasecmp(job->encoder_profile, "main"))
-                 context->profile = FF_PROFILE_H264_MAIN;
+                 context->profile = AV_PROFILE_H264_MAIN;
             else if (!strcasecmp(job->encoder_profile, "high"))
-                context->profile = FF_PROFILE_H264_HIGH;
+                context->profile = AV_PROFILE_H264_HIGH;
         }
 
     }
@@ -1332,7 +1332,6 @@ static void Encode( hb_work_object_t *w, hb_buffer_t *
            when this frame finally pops out of the encoder we'll mark
            its buffer as the start of a chapter. */
         frame.pict_type = AV_PICTURE_TYPE_I;
-        frame.key_frame = 1;
         hb_chapter_enqueue(pv->chapter_queue, in);
     }
 
@@ -1446,17 +1445,17 @@ int encavcodecWork( hb_work_object_t * w, hb_buffer_t 
 
 static int apply_svt_av1_options(hb_job_t *job, AVCodecContext *context, AVDictionary **av_opts, hb_dict_t *opts)
 {
-    context->profile = FF_PROFILE_UNKNOWN;
+    context->profile = AV_PROFILE_UNKNOWN;
     if (job->encoder_profile != NULL && *job->encoder_profile)
     {
         if (!strcasecmp(job->encoder_profile, "main"))
-            context->profile = FF_PROFILE_AV1_MAIN;
+            context->profile = AV_PROFILE_AV1_MAIN;
         else if (!strcasecmp(job->encoder_profile, "high"))
-             context->profile = FF_PROFILE_AV1_HIGH;
+             context->profile = AV_PROFILE_AV1_HIGH;
         else if (!strcasecmp(job->encoder_profile, "professional"))
-            context->profile = FF_PROFILE_AV1_PROFESSIONAL;
+            context->profile = AV_PROFILE_AV1_PROFESSIONAL;
     }
-    context->level = FF_LEVEL_UNKNOWN;
+    context->level = AV_LEVEL_UNKNOWN;
     if (job->encoder_level != NULL && *job->encoder_level)
     {
         int i = 1;
