Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th November 2021, 21:15   #1  |  Link
Blankmedia
Registered User
 
Join Date: Oct 2011
Location: Dans le nord
Posts: 65
TFM and TDecimate analysis pass(es?)

Am I correct to understand that this would be my first pass:


Code:
MPEG2Source(video_path.d2v, info=3)

AssumeTFF()
RoboCrop(LeftAdd=6, TopAdd=2, RightAdd=2,  BotAdd =2, align=True)

TFM(Order=-1,Mode=5,PP=2,Clip2=FieldMatch( Last ),Slow=2,MChroma=False,Ubsco=False,CThresh=12,Chroma=True,output ="video_path_metrics_TFM.txt",d2v="video_path.d2v")
TDecimate(Mode=1, output="video_path_metrics_TDecimate.txt")
and this my second pass:

Code:
MPEG2Source(video_path, info=3)

AssumeTFF()
RoboCrop(LeftAdd=6, TopAdd=2, RightAdd=2,  BotAdd =2, align=True)

TFM(Order=-1,Mode=5,PP=2,Clip2=FieldMatch( Last ),Slow=2,MChroma=False,Ubsco=False,CThresh=12,Chroma=True, input="video_path_metrics_TFM.txt",d2v="video_path.d2v")
TDecimate(Mode=1, input="video_path_metrics_TDecimate.txt", tfmIn="video_path_metrics_TFM.txt")
Or should it be different, like first run only tfm, then a run with TFM and TDecimate, so 2 analysis pass in total.
Blankmedia is offline   Reply With Quote
Old 6th November 2021, 04:26   #2  |  Link
Julek
Registered User
 
Julek's Avatar
 
Join Date: Dec 2020
Posts: 88
Examples: https://github.com/pinterf/TIVTC/tree/master/examples
Julek is offline   Reply With Quote
Old 6th November 2021, 05:33   #3  |  Link
Blankmedia
Registered User
 
Join Date: Oct 2011
Location: Dans le nord
Posts: 65
Quote:
Originally Posted by Julek View Post
Thank you, so if I understand, unless I want to go the vfr way, I don't have to do 2 passes. Am I understanding this correctly?
Blankmedia is offline   Reply With Quote
Old 6th November 2021, 14:33   #4  |  Link
Julek
Registered User
 
Julek's Avatar
 
Join Date: Dec 2020
Posts: 88
Yes, TDecimate mode 1 doesn't need two pass.
Julek is offline   Reply With Quote
Old 6th November 2021, 15:04   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
TDecimate mode=1 isn't a VFR mode, so as Julek said, there's no need for 2 passes.

For VFR mode, the first pass should be mode=4 and the second pass mode=5 for TDecimate.

I usually create both passes in the same script and comment out one pass accordingly. Something like:

# First pass
TFM(output="D:\0101TFM.txt")
TDecimnate(mode=4, output="D:\0101TDec.txt")

# Second pass
# TFM(Input="D:\0101TFM.txt")
# TDecimnate(mode=5, hybrid=2, input="D:\0101TDec.txt", tfmin="D:\0101TFM.txt", mkvOut="D:\0101Timecodes.txt")

# Comment out any addition filtering for the first pass
# SomeFilter

two pass mkv vfr example

Of course you can add other arguments if you wish, but once the first pass has run, be careful not to open the script until you comment out the first pass lines or the metrics files will be over-written and you'll need to run the first pass again.
I'd avoid any filtering before TFM/TDecimate, except maybe standard cropping with Crop() if need be, partly because you don't want it to mess with the creation of the metrics files and partly because it might be be faster if it follows TFM/TDecimate, because it'll probably have less frames to process.

For encoding I usually add the timecodes file to the x264 command line so it can encode in VFR mode.
Alternatively you can add the timecodes file when muxing, but if you give the timecodes file to x264 to play with, there's no need when x264 is writing it's output directly to an MKV (I'm not sure when the output is a raw AVC stream).
The script's output will be at the average frame rate, because Avisynth itself doesn't support VFR, so don't worry if you notice the frame rate is odd.

For the x264 command line:
--tcfile-in "D:\0101Timecodes.txt"

I know nothing about x265 or whether it has a VFR mode.

If you're using a GUI such as MeGUI and adding encoding jobs to the job queue (and using separate scripts for each pass), the timecodes file doesn't need to exist when you add the job to the queue. It'll be created as soon as the second pass script is opened. Of course for each job you add the the queue, the command line for x264 needs to specify the correct timecodes file that'll eventually be created.

Last edited by hello_hello; 6th November 2021 at 15:28.
hello_hello is offline   Reply With Quote
Old 7th November 2021, 03:32   #6  |  Link
Blankmedia
Registered User
 
Join Date: Oct 2011
Location: Dans le nord
Posts: 65
Thank you guys!
Blankmedia is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.