Experienced Forum User, Publisher
Joined: 4/23/2009
Posts: 1283
FixFPS

Fix the frames to a more consistent pattern with the help of Matroska Version 2 Timecodes.  Mostly useful for fixing weird framerate from using a third party program to capture (ex. .kkapture with Mupen).  Generally used with the plugin ExactDedup.  It should be noted that FixFPS would try it's best not to lose any frames from the source.  It does this by pushing frames to the next available spot, if possible, but it can cause side effects.

Usage:

FixFPS(clip c, string times="times.txt", int frames=30000, int div=2, int mul=1)

Where:

c	The clip to use as the source
times	The path to  Matroska timecodes (v2)
frames	The output frame count
div	The divider of the original frame rate to align to
mul	The multiplier of the frame rate after the divide

Example:

Let's say you capture Super Mario 64 with .kkapture and Mupen.  You know the gameplay of Super Mario 64 is 30 FPS, but the intro Nintendo logo is 60 FPS.  Normally the capture from .kkapture is 120 FPS.  So the divider is 120 / 30 = 4 (to align to 30 FPS) and multiplier is 60 / 30 = 2 to output to 60 FPS.  Here is a possible script:

LoadPlugin("ExactDedup.dll")
LoadPlugin("FixFPS.dll")
AVISource("Mario64.avi")
trim(0, 5999) # You might want to align to the divider, so in this case a multiple of 4
ExactDedup(firstpass=false, dupinfo="Mario64 dups.txt")
FixFPS("Mario64 times.txt", 1500, 4, 2)

Changelog:

2017/06/13:
	- Added some smoothing of frames so there is less likely to get jerky movement when the multiplier is greater than 1


2016/02/26:
	- Initial release (real date was a few years ago)

Special thanks to Rolanmen1 for the 64-bit DLL!
Download: https://www.mediafire.com/?7bip52hu7v1pps2
Experienced Forum User, Site Admin, Skilled player (1172)
Joined: 4/17/2010
Posts: 10920
Location: RU
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting. If TASing is meta-play, TASVideos Movie Rules are meta-meta-play!
Experienced Forum User, Publisher
Joined: 4/23/2009
Posts: 1283
Updated the plugin.
Experienced Forum User, Site Admin, Skilled player (1172)
Joined: 4/17/2010
Posts: 10920
Location: RU
Why not git?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting. If TASing is meta-play, TASVideos Movie Rules are meta-meta-play!
Experienced Forum User, Publisher
Joined: 4/23/2009
Posts: 1283
Not enough changes. I don't foresee me changing this much.
Experienced Forum User, Site Admin, Skilled player (1172)
Joined: 4/17/2010
Posts: 10920
Location: RU
I mean it's a project with valuable features, and it's code is open. For history and for the science, it deserves to be hosted on a dedicated platform. And maybe someday it will be forked and expanded. I didn't see the benefit on githubing tas encoding package. Now it's obviously the right path.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting. If TASing is meta-play, TASVideos Movie Rules are meta-meta-play!
Experienced Forum User, Publisher
Joined: 4/23/2009
Posts: 1283
I guess it's true, and I already do have a project on github. So yea, maybe I should put them all, lol.