]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/v4l2_m2m_enc: add support for -force_key_frames
authorAman Gupta <aman@tmm1.net>
Thu, 22 Aug 2019 22:04:48 +0000 (15:04 -0700)
committerAman Gupta <aman@tmm1.net>
Wed, 11 Sep 2019 01:52:37 +0000 (18:52 -0700)
Signed-off-by: Aman Gupta <aman@tmm1.net>
libavcodec/v4l2_m2m_enc.c

index 27bb254fc1185bb1ec472dd312fbe542bd6a3ca9..a0d5bcf7607a4cb5e80f0394c8d2c09be273be50 100644 (file)
@@ -245,6 +245,9 @@ static int v4l2_send_frame(AVCodecContext *avctx, const AVFrame *frame)
     V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
     V4L2Context *const output = &s->output;
 
+    if (frame && frame->pict_type == AV_PICTURE_TYPE_I)
+        v4l2_set_ext_ctrl(s, MPEG_CID(FORCE_KEY_FRAME), 0, "force key frame");
+
     return ff_v4l2_context_enqueue_frame(output, frame);
 }