Log in

View Full Version : Drop every 1001 frame starting at 500/501 (24 to 24/1.001fps)


Stereodude
23rd March 2020, 19:05
I have some content that should have been encoded as 24/1.001fps, but was encoded as 24fps resulting in duplicate frames in the video. Every 1001th frame there is a duplicate frame starting with 500. So it looks like this:

Duplicates:
500 & 501
1501 & 1502
2502 & 2503
3503 & 3504
4504 & 4505
etc...

My AVIsynth-fu is lacking compared to some of you. I know I could write a long list of trim statements + assumefps, but that's inelegant and time consuming. Any AVIsynth tips/tricks?

wonkey_monkey
23rd March 2020, 19:15
First, add 500 frames to the front of your video:


padded_clip = clip + clip.blankclip(length = 500)


This simplifies the problem to dropping frames 1000, 2001, 3002, 4003...

Now drop those frames with

clip.selectrangeevery(1001, 1000)

and then trim off the extra frames:

trim(500,0)

poisondeathray
23rd March 2020, 19:19
Another method is stickboy's deleteevery() . But I don't know if there is a x64 version


DeleteEvery(1001, 500)

Stereodude
23rd March 2020, 19:36
Thanks for the replies wonkey_monkey & poisondeathray.

I tried wonkey_monkey's solution and it's working.