View Full Version : fixe line in anime
shadowlink
12th March 2023, 18:48
Hello everyone, I hope someone can help me. On some anime bonuses, I have contour lines that are not clear.
I tried with an antialiasing but it doesn't work. I don't know the name of this defect or what filters to use.
I have a mkv raws from the same source that doesn't have this problem but it is badly encoded with a bad framerate
when I endode it is like this:
https://zupimages.net/viewer.php?id=23/10/5z71.bmp
raw in mkv :
https://zupimages.net/viewer.php?id=23/10/srfn.bmp
video:
https://mega.nz/file/UOx0lRxL#5RnbSKPY7tYJls9D4f0xxXVYp6ty91oIc0tiaGIJu5k
thank !!
Tempter57
12th March 2023, 22:57
Hello everyone, I hope someone can help me. On some anime bonuses, I have contour lines that are not clear.
I tried with an antialiasing but it doesn't work. I don't know the name of this defect or what filters to use.
I have a mkv raws from the same source that doesn't have this problem but it is badly encoded with a bad framerate
when I endode it is like this:
https://zupimages.net/viewer.php?id=23/10/5z71.bmp
raw in mkv :
https://zupimages.net/viewer.php?id=23/10/srfn.bmp
video:
https://mega.nz/file/UOx0lRxL#5RnbSKPY7tYJls9D4f0xxXVYp6ty91oIc0tiaGIJu5k
thank !!
My script
prefix="C:\Program Files (x86)\AviSynth+\"
AddAutoloadDir(prefix+"plugins64")
setmemorymax(8000)
video = LWLibavVideoSource("C:\Users\Alex\Downloads\00000.m2ts", stream_index=-1, cache=true, dr=false).AssumeFPS(29.970)
audio = LWLibavAudioSource("C:\Users\Alex\Downloads\00000.m2ts", stream_index=1, cache=true, av_sync=false)
AudioDub(video, audio)
ConvertToYV12(interlaced = true)
#pre = last.nnedi3(field=-2).DestripeH().DestripeV().NonlinUSM(pow=1.0, rad=2, str=0.5)
#QTGMC(Preset="Placebo", NoiseProcess=0, edithreads=0)
QTGMC(Preset="fast", sharpness=0.3, edithreads=0)
Crop(244, 134, -244, -134)
ContinuityFixer(left=2, top=2, right=2, bottom=4, radius=2)
spline64resize(428, 240)
srestore(frate=23.976)
maa2()
nnedi3_rpow2(2,cshift="spline64resize",fwidth=852,fheight=480)
awarpsharp(depth=12)
sharpen(0.3)
nnedi3_rpow2(2,cshift="spline64resize",fwidth=1280,fheight=720)
awarpsharp(depth=10)
sharpen(0.3)
maa2()
FastLineDarkenMod4(strength=28,threshold=1, thinning=9,luma_cap=200).awarpsharp(depth=8)
LSFplus(preset="fast", strength=40, preblur="ON")
f3kdb(16,64,64,64,32,16, sample_mode=2,dynamic_grain=false,keep_tv_range=false,dither_algo=3,mt=false)
Selur
13th March 2023, 00:40
I would try to separate into fields and apply the anti-aliasing before the deinterlacing.
Since I was playing around with Vapoursynth (script: https://pastebin.com/epkpxVMr)
here a few Images how aa before deinterlacing could end up:
https://imgsli.com/MTYxNzky, https://imgsli.com/MTYxNzk1, https://imgsli.com/MTYxNzk2, https://imgsli.com/MTYxNzk3
Cu Selur
Reel.Deel
13th March 2023, 01:37
The main problem with this source is cross conversion. But is also has other problems with a few blended scenes and orphaned fields every now and then.
DGSource("00000.dgi")
Crop(242,132,-242,-132)
TFM(pp=0)
TDecimate()
o = last
Debilinear(width/2, height/2)
NNEDI3CL(1, dh=true, dw=true)
Spline36Resize(Width(), Height(), src_left=-0.5, src_top=-0.5)
#Interleave(o,last)
Result: https://imgsli.com/MTYxODEx
I don't have much experience with anime so I just guessed on the desample resolution.
Dogway
13th March 2023, 03:53
Based on Reel.Deel's:
DGSource("00000.dgi",cl=242,ct=132,cr=242,cb=132)
DGTelecide()
TDecimate(mode=1) # anime
DebilinearResizeMT(width/2, height/2)
ConvertBits(32)
ConvertToPlanarRGB(matrix="709:l")
mlrt_ncnn(network_path="2X_DigitalFilmV5_Lite.onnx", builtin=false)
ConvertToYUV420(matrix="709:l")
ConvertBits(8,dither=1)
RatioResize(1280, "adjust2w", kernel="RobiSharp")
ex_smooth(1,0,sharp=true)
flossy_cake
13th March 2023, 04:57
This will do 60fps on an i5-4570 (4c/4t @ 3.4ghz)
# inverse telecine to 24p with frame blending of 30fps sections (eg the pans @ 1:04)
TFM(slow=2, PP=0).TDecimate(hybrid=1, viddetect=2, vidthresh=4.4)
# smooth the field misalignment issue
vinverse(sstr=0.25, amnt=255, scl=1.00)
https://imgsli.com/MTYxODM0
edit: also I died of cringe watching this clip
Selur
13th March 2023, 08:25
@flossy_cake: nice solution. :)
flossy_cake
13th March 2023, 12:11
@flossy_cake: nice solution. :)
Thanks!
But, it chokes slightly at the 0:13 segment which contains blended frames in the source. Can fix that by setting hybrid=0 but then those 30fps pans @ 1:04 will be more juddery.
I think hybrid=1 also handles orphan fields on scene changes in a better way, but it seems to need scthresh=100 in TFM as well... haven't fully figured that one out.
Originally I tried QTGMC to 60p thinking it would smooth out all the anime lines while preserving the frame pacing, but in practice it doesn't - I guess there is just too much field shit going on for QTGMC to deal with. Maybe some magic QTGMC setting could do a better job. But QTGMC @ 1080i is a slow affair.
shadowlink
14th March 2023, 02:56
Thank you for your answer :)
Yes, there is also a blending problem but it's only on a few frames if you encode in vfr. I encoded a first pass with handbrake to have a video in vfr then a second pass with megui :
LoadPlugin("W:\d copie\Logiciels (2)\Encodage edition audio video\MeGUI-2808-32\tools\ffms\ffms2.dll")
FFVideoSource("D:\00001-001 (1)-1-1.mkv")
Crop(246, 0, -246, -0)
LanczosResize(960,720)
SangNom2()
maa()
maa()
maa()
GradFun3 (thr=0.5, elast=2, thr_det=3, smode=2)
LSFmod(defaults="slow", strength=200)
The result is not too bad, the lines are much better but not as much as the raw
to compare, this is the encoding of a chinese team on nyaa, I would like to get closer to that for the outlines
https://mega.nz/file/pOhCFBwZ#S5Bq8bhSUeY6PtjIf4ln-78l7t-pULkaiiN_9iT5asU
flossy_cake
14th March 2023, 09:18
to compare, this is the encoding of a chinese team on nyaa, I would like to get closer to that for the outlines
https://mega.nz/file/pOhCFBwZ#S5Bq8bhSUeY6PtjIf4ln-78l7t-pULkaiiN_9iT5asU
That looks quite good. They seem to have used "thin edges" sharpener as well. Can anyone advise which avisynth sharpening plugin has a "thin edges" filter? I have it in MadVR only right now, would be nice to have in Avisynth as well.
Selur
14th March 2023, 09:24
aWarpSharp(2) sharpens the image while thinning the edges
flossy_cake
15th March 2023, 02:54
aWarpSharp(2) sharpens the image while thinning the edges
:thanks:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.