Vfrac(clip, string timecodesfile, int format) will decimate a hybrid cfr clip to its vfrac equivalent using a v2 timecodesfile. So it does the same as tritical's cfr2tc but:
* can be applied anywhere and anytime in your avs script.
* no useless vfrac raw is created on your HD.
* it is not limited to avi input
* !! it can only handle hybrids limited to one format. For mixed input (extremely rare) you'll need to trim the parts out and handle them separately.
Timecodesfile defaults to "2.txt", only v2 timecodes are accepted.
Format defaults to 1; 1 is NTSC (when you're dealing with a 119.88fps hybrid made out of parts of 119.88fps and partials), 2 is FILM (120fps and partials), 3 is PAL (50fps and partials).
Output is assumed at an arbitrary 24000/1001 fps.
Dupli(clip, string timecodesfile, int format) will create a hybrid cfr clip out of a vfrac by properly duplicating frames where necessary. More or less the same as tc2cfr but again no extra raw file and not limited to avi.
--------------------------
Example: decimate a hybrid 119.88fps raw.
Avisource("119.88fps.avi")
vfrac()
---------------------------
Example: create a 23.976fps cfr workraw out of a vfr raw
ffmpegsource("evilvfr.wmv")
dupli()
selectevery(5)
assumepfs(24000,1001)
---------------------------
Example: overlay cfr karaoke on a vfr clip
(Note that the karaoke needs to changed to 119.88fps before overlaying)
ffmpegsource("evilvfr.wmv")
dupli()
insertsign(last, karaoke.changefps(120000/1001), 3155, 6523)
vfrac()
--------------------------
--------------------------
Synchro(clip1, string timecodesbase, clip2, string timecodesoverlay, string timecodesout, float slack)
Still experimental and only advanced vfr users should dig in.
It outputs clip1 with duplicates frames on times where clip2 has a frame but clip1 does not.
Timecodesbase = v2 timecodesfile of clip1.
Timecodesoverlay = v2 timecodesfile of clip2.
Timecodesout = v2 timecodesfile of the output. (default = "synchro.txt")
Slack = defines the maximum time in ms between a new duplicated frame and an existing frame. It prevents creating duplicates too close to existing frames (equivalent to very high fps) and also prevents misses due to rounding errors. (default = 22.22ms)
Possible uses:
* apply something (karaoke or hardsubs fe) onto dedupped or low fps video without getting timing delays, missing lines and/or jerkiness.
* overlay something onto a clip with entirely different 'framerate' (cfr karaoke onto vfr clip fe) without missing overlay frames and/or inducing jerkiness.
* mux dedupped or low fps video with softsubs (current vsfilter only updates subs when a frame 'passes by' afaik).
* insert other crazy nonsense.
How to:
* clip1 is your base clip
* clip2 is karaoke/subs applied to an empty clip (with uncommon background color in order to catch any pixel change) which is then dedupped with threshold=0.0 .
-------------------------
Download
here.