[FFmpeg-devel] [PATCH 04/25] avcodec/v4l2_m2m_enc: add support for -force_key_frames

Aman Gupta ffmpeg at tmm1.net
Tue Sep 3 04:02:09 EEST 2019


From: Aman Gupta <aman at tmm1.net>

Signed-off-by: Aman Gupta <aman at tmm1.net>
---
 libavcodec/v4l2_m2m_enc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 27bb254fc1..a0d5bcf760 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -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);
 }
 
-- 
2.20.1



More information about the ffmpeg-devel mailing list