libx264 encoder uses AVFrame.pict_type (if provided by user) to use this frame as key frame.
For openh264 encoder this functionality is missing, pict_type simply being ignored. Attached patch fixes it. Valery
From f95943165c91dac13a644365f775aff3dd9edb11 Mon Sep 17 00:00:00 2001 From: vkot <valery....@4cinsights.com> Date: Mon, 5 Mar 2018 13:51:51 +0100 Subject: [PATCH 3/3] avcodec/openh264enc.c: generate IDR frame in response to I frame pict_type --- libavcodec/libopenh264enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index fdadb101f5..12e9ad49ed 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -245,6 +245,10 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } sp.iPicWidth = avctx->width; sp.iPicHeight = avctx->height; + + if (frame->pict_type==AV_PICTURE_TYPE_I) { + (*s->encoder)->ForceIntraFrame(s->encoder, true); + } encoded = (*s->encoder)->EncodeFrame(s->encoder, &sp, &fbi); if (encoded != cmResultSuccess) { -- 2.15.1.windows.2
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel