'FFMpeg dropping frames at end of file using image2 demux with multiple encoders, any solutions?

Alright, real simple here. I'm rendering some fractal flames I've created over the years. Which makes the math on all of this really simple.. lol.

I'm trying to generate a 5 second video at 60fps that when played continuously makes a perfect loop.

So I sequence and render exactly 300 frames numbered 000.png through 299.png for one loop. I then send this into FFMpeg with the following command:

ffmpeg -f image2 -framerate 60 -start_number 0 -i '%03d.png' -r 60 -crf 10 output.webm

No matter what, it kills the last 12-18 frames depending on the run and creates a video that players recognize as 4 seconds only.

Here is a snippet of the processing output (Take note that 300 frames at 60fps no matter what you do comes out at 04.66 seconds - but it does claim there are exactly 5 seconds on the input side)

enter image description here

I have tried replacing -crf setting with just -quality good, I have tried moving around where I state the framerate. I have tried removing the -r from the output and putting it in there. I have tried building out this call to be as specific as possible such as the strictly specifying the encoder and options. Oh I have tried other encoders and get the same result. I have even tried -hwaccell using NVEC and CUVID respectively.

Nothing I do works..

Any thoughts here? Maybe alternatives to FFMpeg? Maybe difference versions of FFMpeg? I don't know what I should do next and thought I would ask.

Diagnostic output on a finished file for reference this one actually got close with 294 frames and a 4.9 second runtime it is much higher res though:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source