diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index 00700ddcb7..a8f0b0c7ca 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -385,7 +385,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         c->next_pts         = AV_NOPTS_VALUE;
 
         av_assert0(pkt->size == req_size);
-        pkt->flags |= AV_PKT_FLAG_KEY;
         *got_packet = !!req_size;
     }
     return 0;
diff --git a/libavcodec/aliaspixenc.c b/libavcodec/aliaspixenc.c
index 22234c091e..01461c984b 100644
--- a/libavcodec/aliaspixenc.c
+++ b/libavcodec/aliaspixenc.c
@@ -96,7 +96,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     /* Total length */
     av_shrink_packet(pkt, buf - pkt->data);
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 6be7f5282a..ff96338e8a 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -299,7 +299,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     pkt->size   = size * 4;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c
index b7f1347056..dac56d1ae5 100644
--- a/libavcodec/avuienc.c
+++ b/libavcodec/avuienc.c
@@ -87,7 +87,6 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c
index 40c2f056fa..1eebf5a4b6 100644
--- a/libavcodec/bmpenc.c
+++ b/libavcodec/bmpenc.c
@@ -154,7 +154,6 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         ptr -= p->linesize[0]; // ... and go back
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/cljrenc.c b/libavcodec/cljrenc.c
index 15fe43e073..aa53a110d0 100644
--- a/libavcodec/cljrenc.c
+++ b/libavcodec/cljrenc.c
@@ -91,7 +91,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     flush_put_bits(&pb);
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index ee45c64ff4..b45fb41515 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -1308,7 +1308,6 @@ encode_coding_unit:
 
     ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c
index fa8b7d5ddc..09036a2125 100644
--- a/libavcodec/dpxenc.c
+++ b/libavcodec/dpxenc.c
@@ -271,7 +271,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     write32(buf + 16, size); /* file size */
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index a464e3ed87..045a29b833 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -1187,7 +1187,6 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
 
     emms_c();
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c
index a594cf5a8d..8bb2ea8386 100644
--- a/libavcodec/exrenc.c
+++ b/libavcodec/exrenc.c
@@ -507,7 +507,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     av_shrink_packet(pkt, bytestream2_tell_p(pb));
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/fitsenc.c b/libavcodec/fitsenc.c
index d96baad986..dfaa04cdbd 100644
--- a/libavcodec/fitsenc.c
+++ b/libavcodec/fitsenc.c
@@ -105,7 +105,6 @@ static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytes_left = padded_data_size - data_size;
     memset(bytestream, 0, bytes_left);
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c
index f4313ecf6d..8db0af3a43 100644
--- a/libavcodec/hapenc.c
+++ b/libavcodec/hapenc.c
@@ -229,7 +229,6 @@ static int hap_encode(AVCodecContext *avctx, AVPacket *pkt,
     hap_write_frame_header(ctx, pkt->data, final_data_size + header_length);
 
     av_shrink_packet(pkt, final_data_size + header_length);
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index 266984c026..97497a8e75 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -994,7 +994,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     s->picture_number++;
 
     pkt->size   = size * 4;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 7ebd6856e0..cd363cb10f 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -1661,7 +1661,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     av_log(s->avctx, AV_LOG_DEBUG, "end\n");
     pkt->size = s->buf - s->buf_start;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c
index a0552b3c54..beae3bb77f 100644
--- a/libavcodec/jpeglsenc.c
+++ b/libavcodec/jpeglsenc.c
@@ -415,7 +415,6 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
 
     emms_c();
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     av_shrink_packet(pkt, bytestream2_tell_p(&pb));
     *got_packet = 1;
     return 0;
diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index 1e15b09624..7deea4f20a 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -103,7 +103,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     pkt->size   = c->zstream.total_out;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 7d29b34b04..3e52bcd4e9 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -708,7 +708,6 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     av_shrink_packet(pkt, writer.pos);
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     ret = 0;
 
diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c
index afaf80047b..180fff93f6 100644
--- a/libavcodec/libwebpenc.c
+++ b/libavcodec/libwebpenc.c
@@ -63,7 +63,6 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         goto end;
     memcpy(pkt->data, mw.mem, mw.size);
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
 end:
diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c
index 537f1576bd..f75e5636b9 100644
--- a/libavcodec/libwebpenc_animencoder.c
+++ b/libavcodec/libwebpenc_animencoder.c
@@ -73,7 +73,6 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                     return ret;
                 memcpy(pkt->data, assembled_data.bytes, assembled_data.size);
                 s->done = 1;
-                pkt->flags |= AV_PKT_FLAG_KEY;
                 pkt->pts = pkt->dts = s->first_frame_pts;
                 *got_packet = 1;
                 return 0;
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index ce5409da34..968ba1fb60 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -259,7 +259,6 @@ static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     flush_put_bits(&pb);
     pkt->size   = put_bits_ptr(&pb) - pb.buf;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index 8a80441cf6..5aef810a58 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -522,7 +522,6 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream2_seek_p(&pb, pos, SEEK_SET);
 
     pkt->size   = bytestream2_tell_p(&pb);
-    pkt->flags |= AV_PKT_FLAG_KEY;
 
     *got_packet = 1;
 
diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c
index c38de5c607..d2ceb33555 100644
--- a/libavcodec/pamenc.c
+++ b/libavcodec/pamenc.c
@@ -123,7 +123,6 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c
index 4c43c9e344..27ebc1b2f4 100644
--- a/libavcodec/pcxenc.c
+++ b/libavcodec/pcxenc.c
@@ -187,7 +187,6 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     pkt->size   = buf - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c
index 2e8b6372a3..8378f90d08 100644
--- a/libavcodec/pnmenc.c
+++ b/libavcodec/pnmenc.c
@@ -142,7 +142,6 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                 ptr2 += p->linesize[2];
         }
     }
-    pkt->flags |= AV_PKT_FLAG_KEY;
     av_shrink_packet(pkt, bytestream - bytestream_start);
     *got_packet = 1;
 
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index b7034eec80..21938c8f34 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -795,7 +795,6 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     AV_WB32(pkt->data, compress_frame_size);/* update frame size */
-    pkt->flags |= AV_PKT_FLAG_KEY;
     pkt->size = compress_frame_size;
     *got_packet = 1;
 
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index 4f303593ce..85651fce2a 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1136,7 +1136,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_be32(&orig_buf, frame_size);
 
     pkt->size   = frame_size;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index 76271e2749..7a72ba4695 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -81,7 +81,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         srcb_line += pic->linesize[1];
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c
index bd992239a5..7e15084d71 100644
--- a/libavcodec/rawenc.c
+++ b/libavcodec/rawenc.c
@@ -76,7 +76,6 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
             AV_WB64(&pkt->data[8 * x], v << 48 | v >> 16);
         }
     }
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c
index d323e41172..5ed5e71cdc 100644
--- a/libavcodec/sgienc.c
+++ b/libavcodec/sgienc.c
@@ -250,7 +250,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     /* total length */
     pkt->size   = bytestream2_tell_p(&pbc);
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/sunrastenc.c b/libavcodec/sunrastenc.c
index b77bed01a5..965ee5b818 100644
--- a/libavcodec/sunrastenc.c
+++ b/libavcodec/sunrastenc.c
@@ -189,7 +189,6 @@ static int sunrast_encode_frame(AVCodecContext *avctx,  AVPacket *avpkt,
         AV_WB32(&avpkt->data[16], s->length);
 
     *got_packet_ptr = 1;
-    avpkt->flags |= AV_PKT_FLAG_KEY;
     avpkt->size = bytestream2_tell_p(&s->p);
     return 0;
 }
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index 82870c089b..cf1733bb2d 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -172,7 +172,6 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     memcpy(out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26);
 
     pkt->size   = out + 26 - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index f8623be3e9..a6c523364a 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -515,7 +515,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_le32(&ptr, 0);
 
     pkt->size   = ptr - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
 fail:
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 1402825fa7..30907faa0f 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -616,11 +616,6 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     frame_info = c->frame_pred << 8;
     bytestream2_put_le32(&pb, frame_info);
 
-    /*
-     * At least currently Ut Video is IDR only.
-     * Set flags accordingly.
-     */
-    pkt->flags |= AV_PKT_FLAG_KEY;
     pkt->size   = bytestream2_tell_p(&pb);
 
     /* Packet should be done */
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index e50886021f..22875be7d5 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -147,7 +147,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         memcpy(buf, side_data->data, side_data->size);
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c
index 6b58bb102c..85fb20729f 100644
--- a/libavcodec/v308enc.c
+++ b/libavcodec/v308enc.c
@@ -65,7 +65,6 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         v += pic->linesize[2];
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c
index e786f71f06..31bf48406c 100644
--- a/libavcodec/v408enc.c
+++ b/libavcodec/v408enc.c
@@ -70,7 +70,6 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         a += pic->linesize[3];
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index 164f939052..d14ecd5d27 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -69,7 +69,6 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         v += pic->linesize[2] >> 1;
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c
index 37773bc382..5e552ce820 100644
--- a/libavcodec/xbmenc.c
+++ b/libavcodec/xbmenc.c
@@ -71,7 +71,6 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     buf += snprintf(buf, 5, " };\n");
 
     pkt->size   = buf - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c
index aa9e905965..55815e5c2f 100644
--- a/libavcodec/xfaceenc.c
+++ b/libavcodec/xfaceenc.c
@@ -206,7 +206,6 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     *(p++) = '\n';
     *(p++) = 0;
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
 
     return 0;
diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c
index d7d18f913c..a65f83abdd 100644
--- a/libavcodec/xwdenc.c
+++ b/libavcodec/xwdenc.c
@@ -211,7 +211,6 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         ptr += p->linesize[0];
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c
index cd4c43b800..c5b211a1c2 100644
--- a/libavcodec/y41penc.c
+++ b/libavcodec/y41penc.c
@@ -72,7 +72,6 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c
index 995c994b53..5181a46403 100644
--- a/libavcodec/yuv4enc.c
+++ b/libavcodec/yuv4enc.c
@@ -55,7 +55,6 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         v +=     pic->linesize[2];
     }
 
-    pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;
 }
