Log in

View Full Version : Anime and filters? Which?


Carpo
13th June 2011, 17:09
I'm guessing it will depend on the video as to what filters i will require, but can some guru in anime encoding point me in the right direction.

Will mainly be DVD as source, might do a few of the blurays, normally I just go with what MeGUI suggests, but I want to get the best out of what i have

Carpo
13th June 2011, 19:44
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("F:\DISC_RIPS\MainMovie\AKIRA\VIDEO_TS\akira.d2v", info=3)
ColorMatrix(hints=true, threads=0)

#deinterlace
crop( 2, 0, 0, -2)

Spline36Resize(720,400) # Spline36 (Neutral)
deen("a2d",4,9,11)
fluxsmoothT()
##mftoon() <----- need help here
##ssxsharpen() and here
colorYUV(gain_u=15)
tweak(sat=1.2)
#denoise

is what i have come up with through some reading, probably old outdated and wrong, but you have to learn somewhere :)

I cant seem to find the files required by mftoon and ssxsharpen, keeps telling me there are no such functions

naoan
13th June 2011, 22:50
Well, DVD sources usually prone to halo, so I usually have dehalo alpha to take care of it. for the two filter, afaik, mftoon has been superseded by toon (just toon) and ssxsharpen is basically a supersampled xsharpen. Deband filter is also a good idea for the last part of the chain to counter the banding usually introduced by the denoiser+sharpener.

Carpo
13th June 2011, 22:53
any idea where i can get the files you speak of? (found toon, cant get my head around the options atm, too tired :p ) Also where can i get and read up on the dehalo alpha you speak of? I am doing a test rip over night and will be posting all the .avs contents as well as x264 commands i used as well as images, hopefully that might shed more light on what i should and shouldn't be using :)

naoan
13th June 2011, 22:57
It's on the main site of avisynth (along with other filter) ;)

http://avisynth.org/mediawiki/External_filters

also posting a raw sample could help :D

mandarinka
13th June 2011, 23:02
Drop that snippet you posted. It for some reason boosts U channel and then adds saturation. Before that is some basic but probably destructive smoothing.

The advice I would give you is: Less is more. Only use filters that are really warranted by particular issues in source (like aliasing or rainbowing). Don't sharpen or smooth (or even play with contrast/saturation) just because. Those aren's mandatory actions.
You will have to learn about what telecine is, how to tell that it was performed on your source and how to treat it, i.o.w. how to perform inverse telecine ('ivtc').
/If it looks that your source is interlaced, it is always (99.99%) telecine instead. Real interlacing usually happens only in credits, with anime./

Carpo
13th June 2011, 23:09
Chears naoan, i should have known i was on that site earlier ;)

mandarinka as i said above in the morning i will post all relevant files so people can tell what a fool i have been and what i should/shouldn't be using ;)

TheProfileth
14th June 2011, 07:06
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("F:\DISC_RIPS\MainMovie\AKIRA\VIDEO_TS\akira.d2v", info=3)
ColorMatrix(hints=true, threads=0)

#deinterlace
crop( 2, 0, 0, -2)

Spline36Resize(720,400) # Spline36 (Neutral)
deen("a2d",4,9,11)
fluxsmoothT()
##mftoon() <----- need help here
##ssxsharpen() and here
colorYUV(gain_u=15)
tweak(sat=1.2)
#denoise

is what i have come up with through some reading, probably old outdated and wrong, but you have to learn somewhere :)

I cant seem to find the files required by mftoon and ssxsharpen, keeps telling me there are no such functions
If I may be so bold as to say why must you be so cruel to Akira :eek: deen, fluxsmooth, tweak? Also mftoon is now vmtoon ssxsharpen is infact USED in vmtoon so I suggest you try this
http://avisynth.org/mediawiki/VmToon
http://mf.creations.nl/avs/functions/SharpTools-v0.3.avs
http://mf.creations.nl/avs/filters/WarpSharp.dll
but please PLEASE don't use deen it is just sort of an evil that tends to plague people's first encodes, try fft3d or something anything other than deen.

Carpo
14th June 2011, 08:08
If I may be so bold as to say why must you be so cruel to Akira :eek: deen, fluxsmooth, tweak?

It's not that i want to be cruel to it, I have never really used any extra filters/scripts before, so during the learning process your bound to make a few mistakes ;)

Will post images and stuff a bit later, need to go out and run a few errands, also anyone know how to split .mkv files into chunks, DGSplit has a fit when i use it on .mkv

Carpo
14th June 2011, 09:16
Here are a few of the files

Screenshots:

Akira - DVD

http://img841.imageshack.us/img841/7239/akiriaoriginaldvdsource.th.jpg (http://imageshack.us/photo/my-images/841/akiriaoriginaldvdsource.jpg/)

Akira - MKV - No Filters --crf16

http://img828.imageshack.us/img828/8371/akiriacrf16mkv.th.jpg (http://imageshack.us/photo/my-images/828/akiriacrf16mkv.jpg/)

Akira - MKV - With Filters --crf16

http://img832.imageshack.us/img832/3213/akiriacrf16updatedavsmk.th.jpg (http://imageshack.us/photo/my-images/832/akiriacrf16updatedavsmk.jpg/)


AVS Files

Akira - No Filters

LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("F:\DISC_RIPS\MainMovie\AKIRA\VIDEO_TS\akira.d2v", info=3)
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\avisynth_plugin\ColorMatrix.dll")
ColorMatrix(hints=true, threads=0)
#deinterlace
crop( 2, 0, 0, 0)

LanczosResize(720,400) # Lanczos (Sharp)
#denoise

Akira - With Filters

LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("F:\DISC_RIPS\MainMovie\AKIRA\VIDEO_TS\akira.d2v", info=3)
ColorMatrix(hints=true, threads=0)

#deinterlace
crop( 2, 0, 0, -2)

Spline36Resize(720,400) # Spline36 (Neutral)
deen("a2d",4,9,11)
fluxsmoothT()
##mftoon()
##ssxsharpen()
colorYUV(gain_u=15)
tweak(sat=1.2)
#denoise

Video Files

Akira - DVD

http://www.mediafire.com/?o7o8ifc3dwx8icf

Overdrive80
14th June 2011, 19:22
Hi, Carpo you could use it:

#denoise

super = MSuper()

backward_vec3 = MAnalyse(super, isb=true, delta=3, overlap=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=2)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=2)

forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=2)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=2)
forward_vec3 = MAnalyse(super, isb=false, delta=3, overlap=2)

MDegrain3(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD=350, thSADC=400)

MSmooth(mask=false, threshold=5, strength=3, chroma=false)

asharp(0.60)

LSFmod(defaults="fast", secure=true, soothe=true, preblur="ON",edgemaskHq=true)

SharpAAMCmod(dark=0.1, thin=0, sharp=100, smooth=80, stabilize=false, aatype="eedi2")

Carpo
14th June 2011, 19:23
Thanks overdrive :) is that specific to the clip i posted, or can that be used on any anime?

TheProfileth
14th June 2011, 20:02
Is there a reason your filtered version looks so ... blue?
Also if you look just about anywhere you end up seeing the effects of deen smoothing flat areas and ruining details.
Also a warning about using filter chains you get from other people
One source's correct filters are another source's worst nightmare.

Carpo
14th June 2011, 20:03
I'm guessing it has to do with one of these two,

colorYUV(gain_u=15)
tweak(sat=1.2)

and i did notice the blue tint, so i will have to do some more tests when time allows :)

TheProfileth
14th June 2011, 20:56
I'm guessing it has to do with one of these two,

colorYUV(gain_u=15)
tweak(sat=1.2)

and i did notice the blue tint, so i will have to do some more tests when time allows :)

Umm try dropping the colorYUV(gain_u=15) and that will fix the issue, I am almost sure.

Carpo
14th June 2011, 21:01
testing your suggestion out on the vob chunk i made :) will post pictures of the new scripts output time permitting

Overdrive80
15th June 2011, 13:22
Thanks overdrive :) is that specific to the clip i posted, or can that be used on any anime?

Hi, it can be used on any anime, only must play with value´s parameters

mandarinka
15th June 2011, 13:36
colorYUV(gain_u=15)
tweak(sat=1.2)

I told you to drop that. :thanks: Why would you want to boost just one of the chroma channels (colorYUV(gain_u=15))? It would only make sense if your source was already ruined in a matchingly-retarded way. Your dvd is fine. Don't do things you apparently don't understand at all.

you can see effects of any filter if you use this in your avisynth script:

interleave(last,(colorYUV(gain_u=15))

Technically, it's interleave(last,X) where X is the filter you want to examine.
It will make it possible to (for example in virtualdub) switch between unfiltered and filtered frame. You can easily see all the atrocities you do to the defenseless video that way. It's a good way to learn.

TheProfileth
15th June 2011, 21:46
Another way to compare is to use this
# _______________________________________________________
#
# SBSC | Side By Side Compare
# _______________________________________________________
#
# Another lame function by Soulhunter... \m\ ^_^ /m/
# _______________________________________________________
#
#
# Usage examples:
#
# Original = AviSource("C:\Path\to\Source.avi")
# Filtered = Original.FFT3DFilter(Sigma=1)
# SBSC(Original,Filtered)
#

Function SBSC(Clip ClipA,Clip ClipB)
{

OX = ClipA.Width
OY = ClipA.Height

ClipB = ClipB.Lanczosresize(OX,OY)

ClipA = ClipA.Crop(0,0,OX/2,OY).Subtitle("ClipA")
ClipB = ClipB.Crop(0,0,OX/2,OY).Subtitle("ClipB")

StackHorizontal(ClipA,ClipB)

this IIRC will allow you to look at the filtered frame right next to the original
or you could try this
Function SBSC2(Clip ClipA,Clip ClipB,int "compare")
{
compare=default(compare,1)

OX = ClipA.Width
OY = ClipA.Height

ClipB = ClipB.spline36resize(OX,OY)

ClipA = ClipA.Subtitle("ClipA")
ClipB = ClipB.Subtitle("ClipB")

(compare==1) ? StackVertical(ClipA,ClipB) : StackHorizontal(ClipA,ClipB)
}
this will allow you to look at the entire frame next to the entire filtered frame and you can either have it above it or below it.

Carpo
15th June 2011, 22:23
Hi, it can be used on any anime, only must play with value´s parameters

That script is giving me about 1-2fps, going to take a day to do it!!!!!!


I told you to drop that. :thanks: Why would you want to boost just one of the chroma channels (colorYUV(gain_u=15))? It would only make sense if your source was already ruined in a matchingly-retarded way. Your dvd is fine. Don't do things you apparently don't understand at all.

you can see effects of any filter if you use this in your avisynth script:

interleave(last,(colorYUV(gain_u=15))

Technically, it's interleave(last,X) where X is the filter you want to examine.
It will make it possible to (for example in virtualdub) switch between unfiltered and filtered frame. You can easily see all the atrocities you do to the defenseless video that way. It's a good way to learn.

I did drop it, i was replying to the question that was asked of "why is there a blue tint" :)

Thanks TheProfileth, I am about to look at the Rickey Gervais show S1, as its animated will see what i can do on that :) Do i put all that in a .avs file? and point it to use the .d2v?

Overdrive80
16th June 2011, 13:00
That script is giving me about 1-2fps, going to take a day to do it!!!!!!


Yes, more o less is processing speed.

Hint: Create two or three scripts, and do rendering pass in vdub of two or three files at once. Then reduce by two or three time.

For example, one script:

LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")

DGDecode_mpeg2source("F:\DISC_RIPS\MainMovie\AKIRA\VIDEO_TS\akira.d2v", info=3)

ColorMatrix(hints=true, threads=0)

#deinterlace

#crop&resize&color
crop( 2, 0, 0, -2)

Spline36Resize(720,400) # Spline36 (Neutral)
Tweak(sat=1.1)

#denoise

super = MSuper()

backward_vec3 = MAnalyse(super, isb=true, delta=3, overlap=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=2)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=2)

forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=2)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=2)
forward_vec3 = MAnalyse(super, isb=false, delta=3, overlap=2)

MDegrain3(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD=350, thSADC=400)

MSmooth(mask=false, threshold=5, strength=3, chroma=false)

asharp(0.60)

LSFmod(defaults="fast", secure=true, soothe=true, preblur="ON",edgemaskHq=true)

SharpAAMCmod(dark=0.1, thin=0, sharp=100, smooth=80, stabilize=false, aatype="eedi2")


#Multithread

threads=3

x=(framecount()/threads)

A=trim(0,x)
B=trim(x+1,2*x)
C=trim(2*x+1,0)


return A

Other script with return B.... Is similar multithread ^^

Carpo
16th June 2011, 14:02
OK I'm lost, do all of these go into .avs file(s) everything i have tried results in vdub crashing, mpc-hc crashing

Overdrive80
16th June 2011, 15:41
Maybe i didnt explain correctly. I attach avs files in rar as example.

In one instance of vdub, load script akira.part1. Open new instance of vdub, load script akira.part2,... Select compression, for example lagarith, and fast recompress. Then save as avi, in each of instances of vdub. :cool:

Overdrive80
16th June 2011, 17:56
Actually I testing this script with Avisynth MT 2.5.8, and fps of processing around 10 and without crash. Example:

SetMemoryMax(512)

SetMTMode(2,0)

DGDecode_mpeg2source("E:\DBZ\DBZ1_2\009\Title_5.d2v", info=3)

ColorMatrix(hints=true, threads=0)

#NO deinterlace


#crop&resize

#Opening
D0=Trim(0,2615).Crop(4,0,-2,0).Spline64Resize(720,480)

#Resumen
D1=trim(2616,4227).Crop(2,0,-2,-8).Spline64Resize(720,480)

#Titulo
D2=trim(4228,4431).Crop(2,0,-0,0).Spline64Resize(720,480)

#Capitulo - 1 parte
D3=trim(4432,17415).Crop(2,0,-2,-8).Spline64Resize(720,480)

#Cortinillas
D4=trim(17416,17699).Crop(2,0,-2,0).Spline64Resize(720,480)

#Capitulo - 2 parte
D5=trim(17700,32423).Crop(2,0,-2,-8).Spline64Resize(720,480)

#Ending
D6=trim(32424,34727).Crop(2,0,-2,0).Spline64Resize(720,480)

#Avance
D7=trim(34728,34901).Crop(4,0,-2,-0).Spline64Resize(720,480)
D8=trim(34902,34939).Crop(4,0,-2,-4).Spline64Resize(720,480)
D9=trim(34940,35163).Crop(4,0,-2,0).Spline64Resize(720,480)
D10=trim(35164,35178).Crop(4,0,-2,-2).Spline64Resize(720,480)
D11=trim(35179,0).Crop(4,0,-2,0).Spline64Resize(720,480)

UnalignedSplice(D0,D1,D2,D3,D4,D5,D6,D7,D8,D9,D10,\
D11)

Tweak(sat=1.1)

#denoise

super = MSuper()

SetMTMode(2)

backward_vec3 = MAnalyse(super, isb=true, delta=3, overlap=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=2)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=2)

SetMTMode(2)

forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=2)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=2)
forward_vec3 = MAnalyse(super, isb=false, delta=3, overlap=2)

SetMTMode(2)

MDegrain3(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD=350, thSADC=400)

SetMTMode(2)

MSmooth(mask=false, threshold=5, strength=3, chroma=false)

SetMTMode(2)

asharp(0.60)

SetMTMode(2)

LSFmod(defaults="fast", secure=true, soothe=true, preblur="ON",edgemaskHq=true)

SetMTMode(2)

SharpAAMCmod(dark=0.1, thin=0, sharp=100, smooth=80, stabilize=false, aatype="eedi2")




Avisynth 2.5.8 MT http://forum.doom9.org/showthread.php?t=148117

Carpo
16th June 2011, 18:10
May have to give MT a look, might help :)

edit: testing it now using your script, obviously the amount of frames are different but it gives me an idea of what to do, getting about 4fps, but that's probably down to my old q6600, when money permits i shall have to upgrade :)

edit2: down to 2.5fps now :p

Carpo
20th June 2011, 19:13
after a lot more testing, seems toon.dll is giving good results, toon(strength=1.0) :)

AzraelNewtype
21st June 2011, 23:20
This isn't particularly vital or anything, but you can add your crop values to the end of the resize arguments if you'd like. You can even do odd pixel cropping this way, as well as avoid mod4 issues.

Carpo
22nd June 2011, 17:19
i always tend to use the mod16 option in MeGUI, although due to work atm i have not had that much time to mess about

edit: i give up, im just going to use toon() , cant be bothered with all the messing about