From 8edaf625f3c38c695c33745822182e94e17d6e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 28 Oct 2015 11:12:42 +0200 Subject: [PATCH] libopenh264enc: Count and warn about the number of skipped frames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavcodec/libopenh264enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 0502bc1a0d..c10409b259 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -39,6 +39,7 @@ typedef struct SVCContext { char *profile; int max_nal_size; int skip_frames; + int skipped; } SVCContext; #define OPENH264_VER_AT_LEAST(maj, min) \ @@ -95,6 +96,8 @@ static av_cold int svc_encode_close(AVCodecContext *avctx) if (s->encoder) WelsDestroySVCEncoder(s->encoder); + if (s->skipped > 0) + av_log(avctx, AV_LOG_WARNING, "%d frames skipped\n", s->skipped); return 0; } @@ -252,6 +255,7 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR_UNKNOWN; } if (fbi.eFrameType == videoFrameTypeSkip) { + s->skipped++; av_log(avctx, AV_LOG_DEBUG, "frame skipped\n"); return 0; }