[FFmpeg-devel] [PATCH 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used

James Almer jamrial at gmail.com
Tue Feb 15 00:41:54 EET 2022


A keyframe could be buffered in the bsf and not be output until more packets
had been fed to it.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 fftools/ffmpeg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6aa0986f02..48d9016b4c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2026,7 +2026,8 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
     }
 
     if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
-        !ost->copy_initial_nonkeyframes)
+        !ost->copy_initial_nonkeyframes &&
+        !(ost->bsf_ctx && ost->bsf_ctx->filter->capabilities & AV_BSF_CAP_DELAY))
         return;
 
     if (!ost->frame_number && !ost->copy_prior_start) {
-- 
2.35.1



More information about the ffmpeg-devel mailing list