From 625214776e63fc4c6dca7e95ab2610e61c228e3b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 16 Aug 2023 21:58:58 -0500 Subject: [PATCH] Print an error if the encoder doesn't produce an IDR frame on demand --- src/video.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index bb25abab..cb05991d 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1282,6 +1282,10 @@ namespace video { return ret; } + if (frame->key_frame && !(av_packet->flags & AV_PKT_FLAG_KEY)) { + BOOST_LOG(error) << "Encoder did not produce IDR frame when requested!"sv; + } + if (session.inject) { if (session.inject == 1) { auto h264 = cbs::make_sps_h264(ctx.get(), av_packet);