Log in

View Full Version : generate_tfmovr - A tool for formatting TFM output files


Ikotas
19th April 2026, 19:30
Current Latest Version -> Click here (https://forum.doom9.org/showthread.php?p=2030615#post2030615)
Version Optimized for Cell Animation -> Click here (https://forum.doom9.org/showthread.php?p=2030790#post2030790)
Examples of How to Use It -> Click here (https://forum.doom9.org/showthread.php?p=2030617#post2030617)

----------

generate_tfmovr v1.0

This tool was created to ensure accurate deinterlacing without errors or omissions.

Description

This tool processes and cleans up TFM output files. It analyzes telecine (interlace) cycles and corrects them into consistent, clean patterns. By eliminating incorrect match code (c/p) detections, it enables high-precision deinterlacing.

Target Sources

Sources telecined from 23.976 fps to 29.97 fps.
Live-action and CG animation.
*Note: Hand-drawn (cel) animation is not supported as its irregular cycles are difficult to analyze.

Required Files

An output file generated by TFM.
Recommended TFM settings for output:
TFM(mode=0,pp=1,slow=2,micmatching=0,output="x:\path\filename.tfm")
*Note: pp=1 is required.

Usage

generate_tfmovr.exe [options] TFM_output_file(*.tfm)

Options

-d <num> : dominantTh (Default: 6)
-m <num> : maintainTh (Default: 3)
-a <num> : adoptionTh (Default: 4)
-c <num> : consecutTh (Default: 2)
-o <file> : output filename

Encoding Settings

deinted=nnedi3(field=-1)
TFM(mode=0,pp=3,MI=200,clip2=deinted,ovr="xxxxx.tfmovr")


I have also published a detailed explanation of the options and a batch file that generates a `SelectEvery` file from the output on GitHub.

https://github.com/Ikotas/generate_tfmovr

Ikotas
20th April 2026, 09:18
generate_tfmovr 1.0.1

Here’s an update right away.
To make a mistake with the file extension…


Correction of output file extensions
Modified to shift the starting frame of a new cycle if it overlaps with
frame p of the current cycle

Download-Github (https://github.com/Ikotas/generate_tfmovr/releases/tag/v1.0.1)

real.finder
20th April 2026, 13:01
sound interesting, I think this can help with cases like field matching in mouth problem https://i.postimg.cc/NjHtwrMk/New-File-19-001588.png

flossy_cake
20th April 2026, 13:21
sound interesting, I think this can help with cases like field matching in mouth problem https://i.postimg.cc/NjHtwrMk/New-File-19-001588.png

Try TFM with mode=6, ubsco=false. That should make it do an additional check if the fieldmatched result is still combed, and look for a less combed match in neighbouring frames. If that still doesn't help, try raising the IsCombed sensitivity with eg. cthresh=9, MI=40.

imo fieldmatching will always be a problem cause at the end of the day when a high detail texture like a pinstripe shirt or a car radiator grille enters the scene where the lines match up with the pixels, it will look like combing and less of a match metric. I reckon the ultimate solution is to do the fieldmatched check per-block so inside each 16x16 window it gets its own match decision. The small windows will still false positive with high detail textures but at least the rest of the frame wont. That's how I reckon the Chinese chipsets like HiSilicon and Amlogic might be doing it, not sure.

Ikotas
20th April 2026, 15:21
generate_tfmovr can perform field matching with near-perfect accuracy for live-action footage.
This is because the algorithm determines that the cycle is continuous if the five basic patterns—cccpp, pcccp, ppccc, cppcc, and ccppc—are present above a certain threshold.
Even in areas where TFM struggles, the algorithm uses a different threshold to classify them as noise, ensuring the cycle remains unbroken.
Each threshold can be specified via options.

The algorithm struggles with the following three points:


Areas where the appearance of basic patterns is delayed due to TFM misclassification around scene changes

-> Matching codes (c/p) judgments may be off by a few frames


Areas in progressive scenes where the above basic patterns appear irregularly

-> Output results may expand, but there is no actual harm


Cell animation

-> Since the above basic patterns do not appear, they are almost always treated as noise, causing detection to fail even if the cycle changes

real.finder
22nd April 2026, 01:55
yes, did try it and it didnt work well with a digital Anime from 2000s (in fact, the field matching become worst!)

is it possible to make a similar tool (or update for this) that correct tfm field matching using http://avisynth.nl/index.php/IT output file? seems it has "string write" parameter, since http://avisynth.nl/index.php/IT seems work best with field matching Anime

orchid
22nd April 2026, 23:55
This sounds like re-inventing the wheel. YATTA is over 20 years old and does the same thing. Unlike this, YATTA also works for animation.

Ikotas
23rd April 2026, 03:16
I've never heard of YATTA before—is it similar to this?
I've been part of the Avisynth community for the past few years, but since I’ve never heard of it, does that mean it’s no longer in use?
If there’s any issue with me reinventing the wheel, please let me know.

It seems everyone here likes anime. After seeing the post #3 on real.finder, I started working on it thinking, “Well, I probably won’t be able to pull this off as well as I’d hoped,” but the output turned out surprisingly good, so I’ll release it later.
I’ll release version 1.1.0 of the live-action version first, and then I’ll get to this.
I’m not sure if the quality will meet your expectations, but please stay tuned.

StainlessS
23rd April 2026, 12:23
does that mean it’s no longer in use?
Alternatives are never a bad thing to have. :) [whether still in use or not, is I believe still used a little bit]

real.finder
23rd April 2026, 12:30
I've never heard of YATTA before—is it similar to this?

YATTA as far as I know, focuses on manual work

so your tool is not re-inventing the wheel

I’m not sure if the quality will meet your expectations, but please stay tuned.

I'm waiting :thanks:

BTW, if your new wheel can do https://github.com/myrsloik/yatta-ivtc/issues/8 then it will be better than YATTA :D (60fps VFR is not only for Anime so it fit for your tool in any cases)

Ikotas
23rd April 2026, 14:07
generate_tfmovr v1.1.0

I believe we’ve improved accuracy by revising some specifications and changing the default settings for certain options!

Changelog / Key Updates


Consecutive Match Priority (-c Option Improvements)
Previously, even if a basic pattern met the consecutive match threshold set by -c, it could be incorrectly discarded as "noise" if a different, more dominant pattern appeared later in the look-ahead window, causing the initial pattern's score to fall below adoption thresholds. The logic has been improved to immediately adopt any pattern that meets the -c requirement, regardless of subsequent competition.


Search Skip for Cycle Stability
The tool now includes a "Search Skip" mechanism. If a potential new cycle (meeting the -c threshold) is detected starting on a frame that is already a valid p position in the current cycle, the transition is suppressed. This prevents unnecessary cycle changes when the current rhythm is still technically accurate.


Updated Default for -c (consecutTh)
The default value for the consecutive match threshold has been increased from 2 to 3.


Updated Default for -a (adoptionTh)
The default value for the weak adoption threshold has been increased from 4 to 5.


New Progressive Detection Options
Added -p (progressTh) and -r (progressRa) to control the detection of progressive sections.


Cycle Preservation Before Progressive Transition
When a progressive section is detected (defined by a ratio of c frames over a specific range), the tool now waits for the current telecine cycle to naturally conclude before switching to the progressive (c) state. This ensures cadence integrity at transition points.


Fixed Output File Naming
Fixed a bug where the -o option was partially ignored due to the input extension being hardcoded as .tfm. The program now correctly respects and passes the user-specified filename directly.


Enhanced Error Messaging
Added specific error displays to notify the user if the input file format is invalid.


Download-Github (https://github.com/Ikotas/generate_tfmovr/releases/tag/v1.1.0)

Ikotas
23rd April 2026, 14:54
For those of you reading this with a casual interest, here are a specific example of what I’ve done.

Practical Examples


Source Notes
The drama consists of the main program (0,77419) + credits (77420,79259) + preview of the next episode (79260,0)
The credits are a text-only type with no scrolling
The preview of the next episode was created by the broadcaster after the fact and consists of clips from the main program, so the cycle changes frequently


Create an AVS file
x:\avs\rxxxxxxxaxxxx#1.avs
DGSource("x:\movie\rxxxxxxxaxxxx#1.ts")
Trim(1392,81549)
TFM(mode=0,pp=1,slow=2,micmatching=0,output="x:\tfm\rxxxxxxxaxxxx#1.tfm")
Return Last


Create a TFM output file using avs2pipemod
avs2pipemod64.exe -benchmark "x:\avs\rxxxxxxxaxxxx#1.avs”
*For some reason, the latest version (v1.3.1) causes an error, so I am using v1.1.1.

The created file is attached.


Create a tfmovr file using generate_tfmovr
generate_tfmovr.exe "x:\tfm\rxxxxxxxaxxxx#1.tfm"
Contents of the created tfmovr file
*Commented-out sections are not included in the output file.
0,78353 ccppc # main program + credits(First half)
78354,79259 c # credits(Second half)
79260,79334 pcccp # The following is a preview of the next episode
79335,79382 cccpp
79383,79449 cccpp
79450,79527 pcccp
79528,79617 cccpp
79618,79715 ppccc
79716,79771 cccpp
79772,79862 cccpp
79863,79901 cccpp
79902,79936 cccpp
79937,79982 ccppc
79983,80037 cccpp
80038,0 c


Create an SE file using convert_tfmovr2se
convert_tfmovr2se.bat "x:\tfm\rxxxxxxxaxxxx#1.tfmovr"
Contents of the created se file
v1=Trim(0,78353).SelectEvery(5,0,1,3,4)
v2=Trim(78354,79259).SelectEvery(5,0,1,2,3)
v3=Trim(79260,79334).SelectEvery(5,0,1,2,3)
v4=Trim(79335,79382).SelectEvery(5,0,1,2,4)
v5=Trim(79383,79449).SelectEvery(5,0,1,2,4)
v6=Trim(79450,79527).SelectEvery(5,0,1,2,3)
v7=Trim(79528,79617).SelectEvery(5,0,1,2,4)
v8=Trim(79618,79715).SelectEvery(5,1,2,3,4)
v9=Trim(79716,79771).SelectEvery(5,0,1,2,4)
v10=Trim(79772,79862).SelectEvery(5,0,1,2,4)
v11=Trim(79863,79901).SelectEvery(5,0,1,2,4)
v12=Trim(79902,79936).SelectEvery(5,0,1,2,4)
v13=Trim(79937,79982).SelectEvery(5,0,1,3,4)
v14=Trim(79983,80037).SelectEvery(5,0,1,2,4)
v15=Trim(80038,0).SelectEvery(5,0,1,2,3)
v1++v2++v3++v4++v5++v6++v7++v8++v9++v10++\
v11++v12++v13++v14++v15

You can download the batch file from GitHub (https://github.com/Ikotas/generate_tfmovr).


Encoding

All that’s left is to encode using your preferred deinterlacer and encoder
deinted=nnedi3(field=-1)
TFM(mode=0,pp=3,MI=200,clip2=deinted,ovr="x:\tfm\rxxxxxxxaxxxx#1.tfmovr")
Import("x:\tfm\rxxxxxxxaxxxx#1.se")
*Reasons why a deinterlacer is necessary

Because the first frame is always interlaced when the pattern after a cycle change is “pcccp”
To clean up any “p” characters that might have been missed in sections with irregular match codes



----------

Verification of Output Results


Difference between the cycle start frame in the tfmovr file and the actual scene change frame

0 c : 0 c (0) ... Always starts at 0
78354 c : 78361 c (-7) ... Since the value is almost always “c” from here on, this is judged to be the start of the progressive section
79260 p : 79260 p (0) ... First frame of the new cycle pcccp
79335 c : 79335 c (0) ... First frame of the new cccpp cycle
79383 c : 79380 c (+3) ... First frame of the new cccpp cycle; visually no movement; TFM has identified 79381 and 79382 - which should be p - as c; the start position of the new cycle is offset, but this is not actually a problem
79450 p : 49451 c (-1) ... Does not match the ‘p’ of the previous cycle; this is the first frame of the new cycle ‘pcccp’, so it is as expected
79528 c : 79529 c (-1) ... First frame of the new cycle 'cccpp'
79618 p : 79619 p (-1) ... Does not match a ‘p’ from the previous cycle; this is the first frame of the new cycle ‘ppccc’, so it is as expected
79716 c : 79716 c (0) ... First frame of the new cycle 'cccpp'
79772 c : 79772 c (0) ... First frame of new cycle cccpp
79863 c : 79867 p (-4) ... First frame of new cycle cccpp; 79865 corresponds to a p in the new cycle, but there is no visible movement, and the TFM has determined it to be a c, so there is no actual issue
79902 c : 79902 c (0) ... First frame of new cycle cccpp
79937 c : 79940 p (-3) ... First frame of new cycle cccppc
79983 c : 79983 c (0) ... First frame of the new cccpp cycle
80038 c : 80040 c (-2) ... Since it is almost entirely c from here on, this is judged to be the start of the progressive interval


Failure to detect cycle changes

None


Necessity of SelectEvery
(The range in which frames are missing or duplicate frames remain when using TDecimate(cycleR=1, cycle=5))
79525,79529 pcccc
79615,79619 cpppp
79770,79774 pcccc
79935,79939 ppccp
79980,79984 pcccc


How to check using AvsPmod
TFM(mode=0,pp=1,slow=2,micmatching=0,ovr="x:\tfm\rxxxxxxxaxxxx#1.tfmovr",display=true)
Write and display the script as shown above, go to the menu and select Macros > Import bookmarks from file,
then import the log file generated by converting the tfmovr file using the convert_tfmovr2bookmark.bat script.

Press F2 or Shift + F2 to verify.

You can download the batch file from GitHub (https://github.com/Ikotas/generate_tfmovr).

Ikotas
23rd April 2026, 20:45
generate_tfmovr4anime.exe v1.0.0

It was quite a challenge to release so many tools in a single day.
I hope you enjoy this one as well.

Description

generate_tfmovr4anime is a specialized tool designed to process and clean up TFM (Field Matching) output files, specifically optimized for hand-drawn (cel) animation. This program uses a unique algorithm to maintain stable telecine cycles even during long still-frame sequences or irregular cel-action where pulses are frequently missing.
By eliminating incorrect match code (c/p) detections and snapping to the earliest consistent boundary, it enables highly accurate and stable field matching for anime sources.

Target Sources

Sources telecined from 23.976 fps to 29.97 fps.
Primary Target: Hand-drawn (cel) animation and anime with irregular cycles.
*Note: For live-action and CG animation, please use generate_tfmovr.

Required Files

An output file generated by TFM.
Recommended TFM settings for output:
TFM(mode=0,pp=1,slow=2,micmatching=0,output="x:\path\filename.tfm")
*Note: pp=1 is required.

Usage
generate_tfmovr4anime.exe [options] TFM_output_file

Options

-t <int> threshold_min_p (default: 6)
-r <float> ratio_threshold (default: 0.9)
-c <float> consistency_acc (default: 0.8)
-w <int> window_size_val (default: 100)
-m <int> min_segment_len (default: 150)
-b <int> boundary_back (default: 300)
-o <file> output filename

--------------------------------------------------------------------------------
Encoding Settings
deinted = nnedi3(field=-1)
TFM(mode=0,pp=3,clip2=deinted,ovr="xxxxx.tfmovr")

*Note: Reasons why a deinterlacer is necessary
Because the first frame is always interlaced when the pattern after a cycle change is pcccp.
To clean up any p characters that might have been missed in sections with irregular match codes.

Please visit GitHub (https://github.com/Ikotas/generate_tfmovr4anime) for options and other details.

real.finder
23rd April 2026, 22:35
generate_tfmovr4anime.exe v1.0.0

thanks! it way better than non-anime generate_tfmovr, but still has some errors!

same Anime is ok with
it(30,dimode=0)

I didnt notice any error!

so that why I asked about convert IT output to tfmovr (Edit: start read from https://github.com/Asd-g/AviSynthPlus-Scripts/issues/15#issuecomment-1767540056)

Ikotas
24th April 2026, 02:46
thanks! it way better than non-anime generate_tfmovr, but still has some errors!

convert_tfmovr4anime is designed to continue the cycle by treating data as noise unless a clear change in pattern is detected, rather than scrutinizing each frame of the TFM log in detail.
(In contrast, convert_tfmovr is designed to perform a detailed frame-by-frame analysis.)
When you mention an "error", are you referring to the fact that it is missing cycle changes around the area where the "Anime mouth problem" occurs?
If the starting point for detecting cycle changes is set too far back, I believe the -b option would resolve this, but is that not the issue here?

Ikotas
24th April 2026, 04:41
I've created a batch file to convert the IT output file into a TFM output file.
Would converting it this way and testing it help resolve the issue?

convert_it2tfm.bat
@echo off
setlocal enabledelayedexpansion

if "%~1"=="" (
echo Usage: convert_it2tfm.bat input.it
exit /b 1
)

set "inputFile=%~1"
set "outputFile=%~n1_it.tfm"

if not exist "%inputFile%" (
echo Error: Input file not found: "!inputFile!"
exit /b 1
)


echo Input : %inputFile%
echo Output: %outputFile%
echo.
echo Processing...

echo #Converted IT to TFM>"%outputFile%"
echo field =>>"%outputFile%"
echo crc32 =>>"%outputFile%"

set /a count=0

>> "%outputFile%" (
for /f "usebackq tokens=1,2" %%A in ("%inputFile%") do (

set "base=%%A"
set "pat=%%B"

for /l %%I in (0,1,4) do (
set /a count+=1
set /a idx=base+%%I
set "ch=!pat:~%%I,1!"

if /I "!ch!"=="p" (
set "out=p - [0]"
) else (
set "out=c - [0]"
)
echo !idx! !out!
)
)
)

echo Done. Converted: %outputFile% (%count% entries)
endlocal
By the way, it appears that using "write=" or "log=" in the IT output file does not change the results.

real.finder
24th April 2026, 12:54
convert_tfmovr4anime is designed to continue the cycle by treating data as noise unless a clear change in pattern is detected, rather than scrutinizing each frame of the TFM log in detail.
(In contrast, convert_tfmovr is designed to perform a detailed frame-by-frame analysis.)
When you mention an "error", are you referring to the fact that it is missing cycle changes around the area where the "Anime mouth problem" occurs?
If the starting point for detecting cycle changes is set too far back, I believe the -b option would resolve this, but is that not the issue here?

yes I mean as "Anime mouth problem", the anime is kinda mixed 12fps and 24fps, I just try with both "-b 1" and then another test with "-b 900" and didn't help

convert_it2tfm.bat

I cant use it directly, but seems I get it to work with ./convert_it2tfm.bat input.it

but I cant use "input_it.tfm" in "TFM(input="input_it.tfm")" it will give my an error! so I convert it with ./generate_tfmovr4anime input_it.tfm and used that input_it.tfmovr with "TFM(mode=0,pp=0,ovr="z:\input_it.tfmovr")" and the "Anime mouth problem" is gone like using "IT(30,dimode=0)"! but there are some frames has comb/interlace problem unlike using the "IT(30,dimode=0)"!

Ikotas
25th April 2026, 01:17
I cant use "input_it.tfm" in "TFM(input="input_it.tfm")" it will give my an error!

The reason you can't load the .tfm file converted by convert_it2tfm.bat directly into TFM's input= is probably because the CRC32 in the header is empty.
I thought so, and when I tried it here, it displayed without any errors.
It can also be loaded via ovr=, so please give that a try.

but there are some frames has comb/interlace problem unlike using the "IT(30,dimode=0)"!

Please explain the “comb/interlace problem” in more detail.

Output file from generate_tfmovr4anime:
0,12999 cccpp
13000,0 cppcc

If the frame number in question is 12345, which of the following applies?

A) The pattern for frame 12345 is cppcc, but it falls within the cccpp range.
(The start position of the cycle change is further back)

B) The pattern for frame 12345 is pcccp, but it falls within the cccpp range.
(The entire cycle was not detected and is missing)

Have you tried all six options?
If you run `generate_tfmovr4anime` in the command prompt while changing the options, with AvsPmod still open, the results will be reflected immediately when you reload AvsPmod, so it should be easy to see the changes.

If possible, I would appreciate it if you could share the IT log or the file after it has been converted to TFM.
In that case, please also let me know the frame numbers where the comb/interlace problem occurs.

real.finder
25th April 2026, 13:32
The reason you can't load the .tfm file converted by convert_it2tfm.bat directly into TFM's input= is probably because the CRC32 in the header is empty.
I thought so, and when I tried it here, it displayed without any errors.
It can also be loaded via ovr=, so please give that a try.

the error message say because of out of the range!
and "loaded via ovr=" will give similar error!

Please explain the “comb/interlace problem” in more detail.

I have a sample using makemkv from DVD, and then cut with LosslessCut

https://files.catbox.moe/2ozm6q.mkv

you can see frame #227 and #242 after using "./convert_it2tfm.bat input.it" then "./generate_tfmovr4anime input_it.tfm" with TFM(mode=0,pp=0,ovr="input_it.tfmovr")

I using this script just in case you need it
LWLibavVideoSource("azumanga fm-00.15.16.161-00.15.39.869.mkv")

#~ it(30,dimode=0,write="input.it") #1st pass

TFM(mode=0,pp=0,ovr="input_it.tfmovr")

Ikotas
25th April 2026, 17:04
the error message say because of out of the range!
and "loaded via ovr=" will give similar error!

I threw together the convert_it2tfm.bat script pretty quickly, so it’s possible it's outputting extra frames.
If you absolutely must import it into TFM, please delete the extra lines manually.


I have reviewed the sample.

Upon visual inspection, the sample had the following cycle:
0,216 cccpp
217,0 ppccc

After outputting the log using IT, converting it to a .tfm file with convert_it2tfm.bat, and then converting it with generate_tfmovr4anime, the output was as follows:
0,240 cccpp
241,393 cccpp
394,0 cccpp

Since this differed significantly from the visual inspection, I specified options and ran the process again, resulting in the following output:

Specified options: -w 50 -b 10
0,212 cccpp
213,0 pcccp

After creating the .se file using convert_tfmovr2se.bat, I checked it with AvsPmod and didn't find any issues.

However, I did notice one thing.
Frame 378 was interlaced.
In live-action footage, both "p" frames are always interlaced, but this does not seem to be the case with anime.
Upon checking, frame 378 was actually a progressive.
Since frames labeled "p" in anime are not necessarily interlaced, the following settings might be better for encoding anime:
LWLibavVideoSource("azumanga fm-00.15.16.161-00.15.39.869.mkv")
src1=last

TFM(mode=0,pp=0,ovr="azumanga fm-00.15.16.161-00.15.39.869.tfmovr")
src2=last

Import("azumanga fm-00.15.16.161-00.15.39.869.se")

ConditionalFilter(src1,src2,"IsCombedTIVTC(MI=200)","=","true")


Note that the leading "p" in "pp" is assumed to be removed by SelectEvery.
Therefore, even if the relevant frame is displayed in interlaced when verified at 29.97 fps using only the following two lines, please do not consider this a problem.
LWLibavVideoSource(“azumanga fm-00.15.16.161-00.15.39.869.mkv”)
TFM(mode=0,pp=0,ovr=“azumanga fm-00.15.16.161-00.15.39.869.tfmovr”)

By the way, I also tried using TFM, and the output was as follows:
0,0 ccppc

Since the result doesn't change even when I specify various options, I think the sample count for the 0,216-cycle pattern in TFM's output is simply too low.
I believe this is due to the source being cut off partway through.
Since IT's output detects it, IT might be the better option.

Ikotas
25th April 2026, 23:54
Sorry, I double-checked visually, and the exact values were as follows:
0,216 cccpp
217,273 ppccc
274,466 ppccc
467,0 ppccc

After trying various options with generate_tfmovr4anime, the following settings produced output that was close to the target.

Specified options: -w 50 -m 60 -b 10
0.212 cccpp
213.279 pcccp
280.453 pcccp
454.0 cccpp

I loaded this file into TFM using AvsPmod to verify it, and it appears there are no issues this time.
While it’s not exactly a quick and easy process since I had to fine-tune the options, I was able to perform the correct conversion from the IT output file.

real.finder
29th April 2026, 16:29
thank you for taking your time to look at it

can generate_tfmovr4anime be updated to have a option to use/correct (c/p) from IT log file?

I threw together the convert_it2tfm.bat script pretty quickly, so it’s possible it's outputting extra frames.
If you absolutely must import it into TFM, please delete the extra lines manually.

I did mod "convert_it2tfm.bat" to
convert_it2tfmovr.bat
@echo off
setlocal enabledelayedexpansion

if "%~1"=="" (
echo Usage: convert_it2tfmovr.bat input.it
exit /b 1
)

set "inputFile=%~1"
set "outputFile=%~n1_it.tfmovr"

if not exist "%inputFile%" (
echo Error: Input file not found: "!inputFile!"
exit /b 1
)


echo Input : %inputFile%
echo Output: %outputFile%
echo.
echo Processing...

set /a count=0

>> "%outputFile%" (
for /f "usebackq tokens=1,2" %%A in ("%inputFile%") do (

set "base=%%A"
set "pat=%%B"

for /l %%I in (0,1,4) do (
set /a count+=1
set /a idx=base+%%I
set "ch=!pat:~%%I,1!"

if /I "!ch!"=="p" (
set "out=p"
) else (
set "out=c"
)
echo !idx! !out!
)
)
)

echo Done. Converted: %outputFile% (%count% entries)
endlocal
if there are some extra frames in the end of tfmovr file, they have to be deleted manually

seems work fine now, thank you so much

Ikotas
1st May 2026, 17:47
generate_tfmovr4anime v1.1.0

New Features:

Support for IT (IT-YV12) output files has been added.


Download -> Github (https://github.com/Ikotas/generate_tfmovr4anime)
Examples of How to Use It -> Click here (https://forum.doom9.org/showthread.php?p=2030617#post2030617)

Ikotas
1st May 2026, 17:51
can generate_tfmovr4anime be updated to have a option to use/correct (c/p) from IT log file?

added support for IT output files, so please give it a try.

real.finder
1st May 2026, 22:21
added support for IT output files, so please give it a try.

thank you so much! I will test it ASAP

real.finder
3rd May 2026, 03:39
Off-topic but somewhat related, is it possible to create an AviSynth plugin to add 60fps sections to the VFR timecode of TIVTC?

I think the plugin is theoretically possible and works as follows: After the usual steps for creating a VFR using TIVTC.

The plugin reads the timecode of TIVTC. Using the clip output from the TIVTC, along with another clip (clip2) that need to be bobbed 60fps, and with some comb detection mechanisms, it determines whether the 30fps sections from the TIVTC clip are actually 60fps if they contain comb (and do timecode adjustment and copy the frames from bobbed clip2) or not (kept as 30fps), and of course, the plugin has another parameter to save the new modified timecode.

Ikotas
3rd May 2026, 11:12
is it possible to create an AviSynth plugin to add 60fps sections to the VFR timecode of TIVTC?

I'm sorry, but that's not really my area of interest...