[FFmpeg-devel] [PATCH] avfilter/framesync: fix forward EOF pts
Nicolas Gaullier
nicolas.gaullier at cji.paris
Thu May 23 17:39:49 EEST 2024
>Envoyé : mardi 21 mai 2024 21:39
>
>Note1: when the EOF pts is not accurate enough, the last frame can be dropped by vf_fps with default rounding.
>
>Note2: vf_scale use framesync since e82a3997cdd6c0894869b33ba42430ac3,
>so this is a very commonplace scenario.
>
>For example:
>./ffprobe -f lavfi testsrc=d=1,scale,fps -of flat \
> -count_frames -show_entries stream=nb_read_frames
>
>Before:
>streams.stream.0.nb_read_frames="24"
>
>After:
>streams.stream.0.nb_read_frames="25"
>---
> libavfilter/framesync.c | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)
Ping ?
Here is another straight way to highlight the issue with a format filter auto-inserting a scale filter thus implying framesync:
>ffprobe -v debug -f lavfi testsrc=d=1,format=yuv420p,fps -count_frames
shows:
Before:
[auto_scale_0 @ X] [framesync @ X] Sync level 0
[Parsed_fps_2 @ X] EOF is at pts 24
[Parsed_fps_2 @ X] Dropping frame with pts 24
[Parsed_fps_2 @ X] 25 frames in, 24 frames out; 1 frames dropped, 0 frames duplicated.
After:
[auto_scale_0 @ X] [framesync @ X] Sync level 0
[Parsed_fps_2 @ X] EOF is at pts 25
[Parsed_fps_2 @ X] Writing frame with pts 24 to pts 24
[Parsed_fps_2 @ X] 25 frames in, 25 frames out; 0 frames dropped, 0 frames duplicated.
More information about the ffmpeg-devel
mailing list