[FFmpeg-user] Loop filter producing off by one errors?

Peter pdc.cse+ffmpeg at gmail.com
Mon Jun 15 09:25:42 EEST 2020


On Mon, Jun 15, 2020 at 3:20 PM Gyan Doshi <ffmpeg at gyani.pro> wrote:

>
>
> On 15-06-2020 07:38 am, Peter wrote:
> > Hello,
> >
> > I'm trying to create a video from a series of PNG frames and then loop
> > specific frames using the loop filter. It is giving me a bit of trouble.
> > Ffmpeg is dropping a single frame somewhere and I'm not sure why that is.
> > Would appreciate it if someone could take a look.
> >
> > Essentially I have a concat demuxer input with 32 frames. I would like to
> > repeat frame #16 104 times. And repeat frame #34 14 times. 32 input
> frames
> > + 104 + 14 = 150 frames. At 30fps, my intention is to produce a 5 second
> > video with exactly 150 frames. But I can only manage to produce 149
> frames.
>
> Can you identify which frame is missing?
>
> Gyan


I'm pretty sure that the last frame is being dropped. That is, the loop of
the last frame is missing. Meaning that this section of the filtergraph is
only producing 13 extra frames.

[layer_1]loop=loop=14:start=32:size=1,

just some extra confirmation:

   - changing "start=32" to "start=31" produces the exact same 149 frame
   video.
   - changing "loop=14" to "loop=15" produces a correct 150 frame video
   (although this seems wrong to me as I would expect a 151 frame video given
   these parameters)


More information about the ffmpeg-user mailing list