[FFmpeg-devel] [PATCH 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used
Anton Khirnov
anton at khirnov.net
Tue Feb 15 13:41:17 EET 2022
Quoting James Almer (2022-02-14 23:41:54)
> 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;
Wouldn't it be simpler to add an OutputStream field that tracks whether
we've seen a keyframe packet yet? No new API required.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list