Log in

View Full Version : AnimeIVTC() - All-in-one solution for interlacing and blending - v2.00 [2010-01-07]


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25

egrimisu
11th October 2009, 10:41
Well, in general, I don't recommend using the automatic deinterlacing functions for real interlaced stuff because they kind of suck. The best way would be to handle it manually. That said, what you must first do is 1) adjust the MI setting so that all the interlaced frames are detected as interlaced (use display=true to confirm) and then 2) set a pp mode (mode=6 is guaranteed to look bad, mode=5 is blend deinterlacing, mode=7 is pretty good, but not as good as a dedicated deinterlacer) or an alternate clip to pull deinterlaced frames from (must have same length). So, you could do something like this:

TFM(clip2=TDeint(edeint=nnedi2),mi=X)

Deinterlaced sections are obviously not 24fps, so you would also need to set TDecimate to a hybrid mode.

Ok please agree with me if my script should look like the next:

Pass1:
mpeg2source("D:\shura\5\VTS_01_1.d2v")
tfm(d2v="D:\shura\5\VTS_01_1.d2v", output="matches.txt")
tdecimate(mode=4, output="metrics.txt")

Pass2:
fulldeint=ttempgaussmc_beta2().selecteven()
mpeg2source("D:\shura\5\VTS_01_1.d2v")
tfm(d2v="D:\shura\5\VTS_01_1.d2v", input="matches.txt";pp=5,clip2=fulldeint)
tdecimate(mode=5, hybrid=2, vfrDec=1, input="metrics.txt", tfmIn="matches.txt", mkvOut="mkv-timecodesfile2passmode.txt")

And another question, what is the diference between one pass encode and 2 pass encode regardig tdecimate? Is tdecimate a filter like DUP?

egrimisu
11th October 2009, 11:31
Strange, using this script the filter did not recognized the fully interlaced scene.Could you please take a deeper look at my script. Thanks in advance
Ok please agree with me if my script should look like the next:

Pass1:
mpeg2source("D:\shura\5\VTS_01_1.d2v")
tfm(d2v="D:\shura\5\VTS_01_1.d2v", output="matches.txt")
tdecimate(mode=4, output="metrics.txt")

Pass2:
fulldeint=ttempgaussmc_beta2().selecteven()
mpeg2source("D:\shura\5\VTS_01_1.d2v")
tfm(d2v="D:\shura\5\VTS_01_1.d2v", input="matches.txt";pp=5,clip2=fulldeint)
tdecimate(mode=5, hybrid=2, vfrDec=1, input="metrics.txt", tfmIn="matches.txt", mkvOut="mkv-timecodesfile2passmode.txt")

And another question, what is the diference between one pass encode and 2 pass encode regardig tdecimate? Is tdecimate a filter like DUP?

thewebchat
11th October 2009, 16:13
Incidentally, this is the method that AnimuIVTC uses if you actually read the sea of "code" it's buried under.

1) Using both pp and clip2 is redundant.
2) I'm pretty sure you need to deinterlace both passes (the information is stored in matches.txt)
3) Use the display=true parameter to TFM to see what it says about the interlaced scene (the MIC value)
4) If you can't get TFM to detect it, you can always stick a blind deinterlacer after TFM and before TDecimate.
5) There's no reason TDecimate has to work in multiple passes except that AviSynth needs to know the length of the video in advance.

egrimisu
11th October 2009, 20:47
using display=true the mic value is 0 or 1 and in some cases rising, for 99% of the video, the fully interlaced scene had from 0 to 10 but the match value is allways C in standard video is 3 C frames and 2 P frames. And tried the next scrip in one pass but the result is still fullyinterlaced:

mpeg2source("D:\shura\5\VTS_01_1.d2v")
tfm(d2v="D:\shura\5\VTS_01_1.d2v", display=true, clip2=tempgaussmc_beta2(edimode="eedi2").selecteven())

i still have a question, if the frames will be corectly deinterlaced how will afect the framerate of the finaly video??? i believe i still need the next line:

tdecimate(mode=3, hybrid=2, vfrDec=1, mkvOut="mkv-timecodesfile222.txt")

Incidentally, this is the method that AnimuIVTC uses if you actually read the sea of "code" it's buried under.

1) Using both pp and clip2 is redundant.
2) I'm pretty sure you need to deinterlace both passes (the information is stored in matches.txt)
3) Use the display=true parameter to TFM to see what it says about the interlaced scene (the MIC value)
4) If you can't get TFM to detect it, you can always stick a blind deinterlacer after TFM and before TDecimate.
5) There's no reason TDecimate has to work in multiple passes except that AviSynth needs to know the length of the video in advance.

thewebchat
11th October 2009, 21:33
You mentioned that you have used AnimuIVTC to handle these sources correctly. What settings for AIVTC did you use? Also, perhaps you need to upload a sample. TIVTC's algorithms can not correctly detect some kinds of subtle combing, such as interlaced fades or field artifacts from bad compression.

When you have fully interlaced content in an otherwise telecined video, that part can not be decimated to 24fps cleanly, so those sections must be handled by blending or VFR. This is because an interlaced video has no temporal redundacy in it.

egrimisu
12th October 2009, 06:58
Ass i know animeivtc can't deal with hardtelecine and full interlace automaticly, you must add istart iend pstart pend, and that's distrubing since i don't have the time to search every ep for these scenes.
"You mentioned that you have used AnimuIVTC to handle these sources correctly" No my question began like this:
"dumb question, my anime contains hardtelecine scenes and fully interlaced scenes, cand these be found automaticly by animeivtc and deinterlace them? "
and you answered:
"Yes, it can. That is because AnimuIVTC is nothing more than a (bad) wrapper around TIVTC, and TIVTC is already fully able to handle mixes of progressive, telecined, and interlaced content. "
i know that i have to use vfr with mkv that's why i asked about tdecimate (tdecimate creates the timecode file). I'm posting the sample. At the end o the credits is a scene with full interlaced scene, i would like this to be compresed af 29.97fps hald fullres(i believe this is it's name), the the rest is 23.97fps after deinterlace.

http://www.megaupload.com/?d=ZSONAVPI
i hope this helps,

thewebchat
12th October 2009, 16:22
Oh, I see. You are right that TIVTC is unable to detect this one. I apologize for posting misleading information. Incidentally, you can lower cthresh and MI to get TIVTC to find the interlacing in that part, but it seems that the old way of finding it manually is better.

egrimisu
13th October 2009, 10:16
the problem is that the old way is a slow way... a very slow way :)

what the lowest and the highest values for MI and cthresh?

Oh, I see. You are right that TIVTC is unable to detect this one. I apologize for posting misleading information. Incidentally, you can lower cthresh and MI to get TIVTC to find the interlacing in that part, but it seems that the old way of finding it manually is better.

thewebchat
13th October 2009, 15:53
0-255. 0 = everything is combed, 255 = nothing is combed. However, changing these by too much will probably lead to unexpected results.

egrimisu
14th October 2009, 08:00
0-255. 0 = everything is combed, 255 = nothing is combed. However, changing these by too much will probably lead to unexpected results.

yest changef ctrecch to 3 and MI to 32 and the interlaced section was properly deinterelaced but other 3/2 patern frames were detected like pure interlaced and a total 30000 frame anime was finally 40000. :(

So any other solutions, any other than manual?

And thanks again for helping

thewebchat
15th October 2009, 05:54
@egrimisu: I just found by experimentation that a high block size for TFM (blockx=32, blocky=32) along with a reduced cthresh and MI (cthresh=4, mi=40) was able to detect the interlaced section while producing equivalent results for the telecined section on your sample. There is one frame at the end (frame 273) that is incorrectly detected as interlaced both with the modified and the normal settings. Since these are all based on heuristics, I'm 100% certain that this will fail hard somewhere else in your video.

egrimisu
15th October 2009, 12:52
just checked the setings, there are lot and lots of wrongly detected frames in the firs minute of the anime.

@egrimisu: I just found by experimentation that a high block size for TFM (blockx=32, blocky=32) along with a reduced cthresh and MI (cthresh=4, mi=40) was able to detect the interlaced section while producing equivalent results for the telecined section on your sample. There is one frame at the end (frame 273) that is incorrectly detected as interlaced both with the modified and the normal settings. Since these are all based on heuristics, I'm 100% certain that this will fail hard somewhere else in your video.

tengo6dedos
22nd October 2009, 14:28
Hello, can you tell me if its safe to use mt plugin via "SetMTmode" when dealing with double-hard telecine and hard telecine with this script. When should i not use it?
Thanks

thetoof
22nd October 2009, 18:17
I don't think any decimation operation will work well with setmtmode... but you can give it a try and see what it does.

However, if you want to be absolutely safe, do the operations externally so you can specify mode=2 or 5.

DHT
setmtmode(2)
source
bob (yadifmod or tdeint with nnedi2 for interpolation)
setmtmode(5)
tdecimate(1,3,5)
...

ht:
setmtmode(2)
source
setmtmode(5)
tfm with all the addons you want (nnedi2, tmm...)
tdecimate
...

field-blended:
setmtmode(2)
source
bob
setmtmode(5)
srestore
...

thewebchat
22nd October 2009, 18:21
Just want to point out that if you're using emask=TMM or edeint=nnedi2 or clip2=nnedi or something, you can call those before SetMTMode(5) and store them to a clip.

SMM(2)
source
nn = nnedi2
mm = tmm
SMM(5)
tfm(blah)
tdecimate(blah)

Also, if you're feeling lucky, you could analyse only part of your clip and return full frames from another clip using those partial analysis decisions (generally not a good idea, but faster).

thetoof
22nd October 2009, 19:04
Yes, but tmm is extremely fast and nnedi2 can use mt internally, so it doesn't change much, except maybe using more memory.

thewebchat
22nd October 2009, 22:44
Oh, that is right, but then there is no reason to use SMM at all since you could just use an internally-threaded decoder.

thetoof
23rd October 2009, 00:54
True, if only IVTC is performed. However, it is needed for additional processing requiring smm to be properly multi-threaded, which I thought was implicitly said by adding ... at the end of every script example. And yes, in case you bring up this point, it would require another call of smm to set the appropriate mode.

tengo6dedos
29th October 2009, 19:22
Thanks for the renponse. A while back you mentioned to me you were building a new version of AnimeIVTC, is this still happening or its on hold for the moment?

thetoof
30th October 2009, 17:08
This is still happening and currently being tested. The new guide is not ready yet, so that's why it's not out.

Overdrive80
31st October 2009, 00:17
hi, Exist any form to rename o edit script for can use mvtools2?

I rename mvanalyse to manalyse, but say that "pel" no is defined. In manualīs mvtools2 see that parameters "pel" is in MSuper function.

Excuse for me english.

Congratulations thetoof!!

thewebchat
31st October 2009, 02:05
To convert a command in the form of
vectors = MVAnalyse(clip,isb=R,delta=Z,pel=X,idx=Y)
for use with MVTools2, you should write it as
super = MSuper(clip,pel=X)
vectors = MAnalyse(super,isb=R,delta=Z)

boxXx
31st October 2009, 10:20
Peepz,

I've got 2 sources i want to encode here but for some reason i can't get it to properly deinterlace the movie, now i wanna try this plugin but i have no idea what to use, could someone please help me out a little bit ?
Here are 2 samples of the 2 sources :

Source 1 (http://www.pokemon-nl.org/sample/spongebob1.VOB)
Source 2 (http://www.pokemon-nl.org/sample/spongebob.VOB)

Thanks in advance !

Btw nice going with the filter !

supernater
31st October 2009, 11:08
Peepz,

I've got 2 sources i want to encode here but for some reason i can't get it to properly deinterlace the movie,

They appear to be hard telecined. The pattern is progressive, progressive, progressive, progressive, interlaced. mode 1 should work. I used this line and it worked fine...

animeIVTC(mode=1, aa=0)

boxXx
31st October 2009, 11:25
Awesome ! thanks, now just one more question when i try to open the script in AVSP or MPC doesn't really matter it gives me the following error :

Script Error : There is no function named "nnedi"
(AnimeIVTC.avsi, line 126)
(Spongebobspongicus.avs, line 2)

what am i doing wrong ?

Script :


DGDecode_Mpeg2source("J:\Spongebob\spongicus\VideoFile.d2v")
animeIVTC(mode=1, aa=0)
crop(4,2,-2,-2)
Spline64Resize(640,480)
converttoyv12()

supernater
31st October 2009, 13:24
Awesome ! thanks, now just one more question when i try to open the script in AVSP or MPC doesn't really matter it gives me the following error : Script Error : There is no function named "nnedi"


I ran your script and did not get that error. Do you have the nnedi.dll in the folder C:\Program Files\AviSynth 2.5\plugins? Check the plugins folder of your avisynth directory. If you don't have it download it from here (http://web.missouri.edu/~kes25c/nnedi_v1.3.zip) and put it in your avisynth plugins directory. Post back if you get the same error.

Just FYI, make sure that you have all the plugins that animeIVTC requires in your avisynth plugins directory

boxXx
31st October 2009, 13:33
Now it says :

No function named "Reduceflicker" tried to add it manually to the folder but it doesn't seem to work, the other ones did tho.

Thanks !

supernater
31st October 2009, 14:35
Now it says :

No function named "Reduceflicker" tried to add it manually to the folder but it doesn't seem to work, the other ones did tho.

Thanks !

Hmmmm. Make sure you have the correct version of ReduceFlicker. I use the ReduceFlickerSSE3.dll. Aside from that, your issues seem to be either you have the wrong version of the necessary plugin or you don't have the plugin. I guess the best thing to do is try different versions of the plugin that is giving you errors until you find the correct one.

thewebchat
31st October 2009, 17:04
ReduceFlicker requires AvsRecursion and MSVCRT 7.1 to be installed as well (to system32).

boxXx
31st October 2009, 17:22
Had to get some more filters to get it to work, it works now THANK GOD doom9 excists hehe :D

Thanks everyone for your awesome help !

egrimisu
1st November 2009, 21:43
what do i need to change after moving to avisynth 2.5.8? i get some cdebelnd error.

Nightshiver
1st November 2009, 23:47
Download the required plugin's pack and put all of those in the plugins folder......

egrimisu
2nd November 2009, 14:00
Download the required plugin's pack and put all of those in the plugins folder......

it works for 2.5.7 but for 2.5.8 no

Nightshiver
2nd November 2009, 18:56
Yes, it does. I'm using it right now. There is no reason why any of them would not/should not work.

boxXx
4th November 2009, 14:50
ReduceFlicker requires AvsRecursion and MSVCRT 7.1 to be installed as well (to system32).

I'm on wndows 7 now and cant seem to get it to work :/

What should i do ? cause the MSVCRT dll says file version is 2600 which is Windows xp and the msvcrt dll which allready exists in the folder is version : 7600 which is windows 7.

Thanks in advance.

thewebchat
4th November 2009, 17:02
http://www.google.com/search?q=mscvr71
http://www.google.com/search?q=mscvp71

boxXx
4th November 2009, 19:13
" The file or folder is open in another program " am i supposed to add it in savemode ?

Thanks.

thewebchat
4th November 2009, 21:34
Clearly, if you already have MSVCRT 7.1, you don't need to install it again.

boxXx
5th November 2009, 07:43
then why does it still give me the avisynth error ?

osgZach
5th November 2009, 17:32
Hmm. I successfully used AnimeIVTC on Gall Force: Eternal Story, (mode 2 / 5 both had the same effect, so I'm not sure if this thing was hard telecined or what, I've got Int / Prog frames in no specific pattern but mode 5 was a hell of a lot faster and came out flawless)

However I'm working on its sequel now, and getting that CRC32 mismatch error posted about many pages back.

Using the same scripts I used on Eternal Story so nothing has changed per say. I did rename my d2v after I built it, but I couldn't see how that would mess things up.. anyway I moved the VOB's from my DVD to the HDD to see if that will help, and have rebuilt the d2v, currently going through the analysis pass again.. I could have swore it was -way- faster on Eternal Story though (and that has more frames)


d2vpath = "Destruction.d2v"
mpeg2source(d2vpath)
crop (10, 0, -10, 0)
Spline64Resize(640,480,0,0)
AnimeIVTC(mt=true, pass=1, mode=5, aa=0)


Second script is exactly the same, except for pass = 2

Anything I can do in the meantime to double check I have everything proper? and assuming I still get this error, would chopping off the first few frames make any difference? (there are some copyright screens, etc I can afford to lose, though I don't want to have to fuss with audio sync)

OS: Win7 x64
Latest CCCP
AnimeIVTC 1.06 (10/8/2008?), AviSynth 2.5, Virtualdub 1.9.7 (x32)

thewebchat
5th November 2009, 23:51
I think the more important question is why you are resizing before you deinterlace.

osgZach
6th November 2009, 17:49
Honestly, I don't know.. But I do know that the output looks pretty normal so far. I -had- heard you shouldn't upscale before de-interlacing, but not the other way. But then I suck at finding "good" information too.

But if someone could humor me on the technical aspect of why you shouldn't, it would probably be something nice to learn about. As to why I wrote it that way, I reasoned, less data to de-interlace, less work time.. Is that wrong?


re: crc issue.. so I did what was suggested and just commented out the CRC fields in the TFM & stats (did both just to be safe) and it no longer bitches at me.. although I thought I read this issue was fixed? which led to my post.. Maybe I misunderstood, or I've got an old version off a web page from somewhere.

Gavino
6th November 2009, 18:14
But if someone could humor me on the technical aspect of why you shouldn't, it would probably be something nice to learn about.
When you vertically resize, each output scanline is in general constructed by combining two or more of the original lines in some way (eg linear interpolation). If you do this before de-interlacing, you are mixing information from the two fields, making it impossible to separate them properly.

osgZach
6th November 2009, 18:23
Ah.. so, kind of like a really ugly blend you can't get rid of?

osgZach
8th November 2009, 18:22
Possible bug.. Or maybe I'm just being stupid and missing something (you didn't axe mode 6 right? lol )

I wanted to try Mode = 6 on the aforementioned video I'm working with, just to see what it would do (I thought I would see if I was just missing the telecine pattern, but this thing has got to be hybrid. mode 2 decimates to 23.976 and its jerky. IVTC w/out decimation gives smooth/jerky OTOH. While mode 5 seems fine except for blends.) since 5 for some reason produced blending. (do I need to tweak a setting for mode 5?)


Anyway it keeps throwing me :invalid arguments to function "vinverse", on line 348.

I stripped it down to the bare minimum of: AnimeIVTC(mode=6) chopping off other commands as I went, and it does it in any situation.

Also, using the latest update of the script, 1.0.6.1

boxXx
8th November 2009, 18:24
Clearly, if you already have MSVCRT 7.1, you don't need to install it again.

please someone ?it still wont work.

Nightshiver
8th November 2009, 20:05
@osgZach: Do you have vinverse? For this, I suggest removing all plug-ins that are not required for AnimeIVTC, and only put the plug-ins that AnimeIVTC uses in there. Using mode=5 or 6 is VFR, so your AnimeIVTC line MUST read like this for the first pass:

AnimeIVTC(mode=6,aa=0,pass=1)

Run an analysis pass for this. It will make some txt files. Next, change the line to this:

AnimeIVTC(mode=6,aa=0,pass=2)

This is your encode line.

osgZach
8th November 2009, 20:08
Yeah I checked for the plugin and I do have it. I pretty much moved all plugins into the plugins directory, though I chose not to overwrite some that were present because they appeared to be the same version..

However I will see about recopying, or also just wiping the directory and using whats in the archive. I already did a previous VFR encode for Eternal Story in mode5, with my lines looking like what you posted for each pass (sans crop/resize and I used aa=4).. I'm still a little puzzled why it seems to be free of blends, but Destruction wasn't. Could the AA mode be introducing blends in some way? Or did you just specify 0 for example

I'll have to try it out later tho, as I'm running another mode5 pass(s) with a modified vidthresh to see what that does (it does say to decrease if its mostly Video, DGindex claims their all 100% Video but I'm somewhat suspect of how to interpret that since its a mix of telecined / progressive without a pattern)

osgZach
8th November 2009, 20:26
By the way..consulting the Documentation is confusing me, based on your example..

pass : Processing a hybrid clip requires two passes. The file you must use for your final encode/subsequent filtering must be the one generated by pass=2.

* 0 : Special pass to process your stream in mode=3, 4 or 6 without decimating by doing a lossless rendering pass. You can then reload the resulting file as avisource("yournewfile.avi").animeivtc(mode=7, pass=1, other vfr settings) to apply vfr decimation. It helps reducing overall processing time. (default for mode=3, 4 and 6)
* 1 : Open with vdub, file-run video analysis pass, wait until the end, close vdub. (default for mode 5 and 7) Using this for mode=3, 4 or 6's rendering pass combines the rendering pass and the analysis pass for VFR decimation.
* 2 : Reload the same script with pass=2 and do a lossless rendering pass. Encode. Then, take the "timecode.txt" file and add it as the timecode for the video stream in mkvmerge.


edit: As you provided, I still get a problem with vinverse. It points to line 348 of both the previous 1.0.6 and 1.0.6.1 script.
I removed all plugins, except for DGDecode (to load the D2V)... So not sure whats wrong.. I copied all the plugins from the AnimeIVTC package I downloaded. (1.0.6)

Here is line 348 from the AnimeIVTC script


dec1=(check!=11 && check!=5) ? errormsgs : toprocess.vinverse()

Chengbin
8th November 2009, 22:09
What mode should I use if my source is 23.976? I would like to keep the framerate as it is. My source is soft telecined, and in your gude it says "Soft telecined, so your stream can easily be extracted at the film rate"

"You are happy! :p Use "Force film" in DGIndex and IVTCing/Deinterlacing/Deblending doesn't concern you anymore! "

What do I do? I have to select a mode.