[FFmpeg-cvslog] avcodec/v4l2_m2m_enc: add support for -force_key_frames

Aman Gupta git at videolan.org
Wed Sep 11 04:53:38 EEST 2019


ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Thu Aug 22 15:04:48 2019 -0700| [ab4835f41885c0f2e2f75101d72b888557c0e284] | committer: Aman Gupta

avcodec/v4l2_m2m_enc: add support for -force_key_frames

Signed-off-by: Aman Gupta <aman at tmm1.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab4835f41885c0f2e2f75101d72b888557c0e284
---

 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);
 }
 



More information about the ffmpeg-cvslog mailing list