Option to fix videos with extra frames due to framerate conversion

I have several files which have come from streaming site downloads where the frame rate encoded is not the original frame rate. Many for example have 29.97 fps but were from say 23.98 fps and have extra duplicate frames inserted at regular intervals. Similarly I had a video encoded at 25 fps from a 24 fps source, exactly one extra duplicate frame per 25 at a regular interval.

This gives annoying jumps in video. I have tried frame interpolation, at it can help fix this, but it processes all frames and has causes some transitions to be interpolated incorrectly so overall is not a good solution. A simple tool to analyse and interpolate regular interval frames (could easily be calibrated testing for frame duplication frequency medians) leaving the rest intact. Would be magic for those instances (and I have many files like this).

Best regards,

John.

It’s the same story with DVD rips.
Learn the ways of ffmpeg. Simply setting -r 23.976 will usually drop duplicate frames perfectly.
If not, you can use the decimate filter: -vf decimate=cycle=25, will drop one frame that it detects to be a duplicate every 25 frames.

The first one is easy to fix. Just convert it to 23,976 fps with a video tool of your choice before processing with Video AI. :slight_smile:

Thank you for that advice. I tried it on the 25 Fps file that had 24 frames + duplicate. It did output a 24 Fps file but wasn’t perfect at getting the right duplicate. Some stretches worked better than others. So progress. I still think having a feature to smooth files with a regular duplicate pattern would be relatively easy to add in Topaz directly. Part of the issue as well is I get the impression the duplicate sometimes replaces a legitimate frame so the 25 Fps video was a 25 Fps source, somehow bodged to 24 Fps then patched back to 25 Fps duplicating a frame so removing the extra frame leaves a jump in motion. Replacing it with an interpolated one would be perfect, but Topaz seems a big imperfect at doing this when looking in general for duplicates.

Yeah, if they put their minds to it, Topaz should be able to make the best tool for correcting frame issues.

I just recently figured out a fix for a similar issue I had with some NTSC DVDs I have. They are interlaced, so when I deinterlace them, I double the frame rate, then I run the decimate filter twice in a row with decimate=cycle=2 being the first one.

So even if yours in not interlaced, you can still run the deinterlacer and it will be fine. You should be able to run something like bwdif=mode=1:parity=-1:deint=0,decimate=cycle=2,decimate=cycle=25.