Hi can someone take a look at the sample and help me with best way to achieve this with Avisynth.
I want to De interlace video and change fps to original and cleanup as much as possible. So far i have this written up script but my knowledge in avisynth aint great:
sample:Code:a = LWlibavAudioSource("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v = Mpeg2Source("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) import("C:\Users\akuma\AviSynth+\plugins64+\RemoveDirtMC.avs") TFM() TDecimate(Cycle=5, CycleR=1) ColorMatrix(mode="rec.601->rec.709") Crop(14, 60, -12, -56, align=false) RemoveDirtMC(50, false) KNLMeansCL(d=1, a=2, h=1.4) SMDegrain(thsad=102, tr=1, PreFilter=4) Spline36Resize(720, 322) Sharpen(0.5, 0.0) MergeChroma(aWarpSharp2(depth=15)) prefetch(24)
https://www.swisstransfer.com/d/aa5a7153-746e-47eb-adbc-7e57d60ca203
+ Reply to Thread
Results 1 to 13 of 13
-
-
Ignoring the cleaning steps, since you are looking to 'De-Interlacing properly and changing 29.970fps of DVD to 23.970fps' ?
What's wrong with:
Code:TFM() TDecimate(Cycle=5, CycleR=1)
The way you do it atm., seems like a proper way to apply ivtc and going from 29.97fps to 23.976 fps.
(adding vinverse or vinverse2 helps with some residual combing)
Cu Selur
Ps.: for the denoising: using DeSpot and SmDegrain with a high thSAD/-SAC might be a less destructive approach and keep more details.
PPs.: playing around with this a bit, applying DeSpot+CAS+SmDegrain on the separated fields before applying TIVTC seems like a good approach.Last edited by Selur; 3rd Aug 2025 at 01:42.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
The immediate source was 25fps . It should be 1 in 6 decimation, otherwise you drop good frames. You can slow it down afterwards along with the audio or leave it
-
Thanks Selur & Poisondeathray.
I tried this:
Code:a= LWlibavAudioSource("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v = Mpeg2Source("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) import("C:\Users\akuma\AviSynth+\plugins64+\RemoveDirtMC.avs") ColorMatrix(mode="rec.601->rec.709") Crop(14, 60, -12, -56, align=false) TFM() TDecimate(Cycle=6, CycleR=1) Vinverse(sstr=2.7, amnt=255, uv=3, scl=0.25) DeSpot(p1=60, p2=45, mthres=100, motpn=true) SMDegrain(thsad=818, tr=6, PreFilter=4) Spline36Resize(720, 322) CAS(0.8) prefetch(24)
[Attachment 88093 - Click to enlarge]
But if I replace Line 10 on script with RemoveDirtMC(40) instead of DeSpot, I get no artifacts (see pic for comparison):
[Attachment 88094 - Click to enlarge]
Maybe my settings on filters are wrong. Any advise would be greatful. -
I suggested applying the filters in a different order (DeSpot+CAS+SmDegrain) and on the fields.
So you would have to separate the fields, apply the filters, then weave the fields and apply ivtc to try what I suggested.
You might also want to add DeScratch, a deblocking filter and SSIQ.
Using and tweaking BM3D might also be worth a look if speed is not an issue,...Last edited by Selur; 3rd Aug 2025 at 11:52.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
Thanks Selur. Think I've done it correctly now.
Script:
Code:a= LWlibavAudioSource("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v= Mpeg2Source("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) ColorMatrix(mode="rec.601->rec.709") Crop(14, 60, -12, -56, align=false) SeparateFields() DeSpot(p1=60, p2=45, mthres=100, motpn=true) CAS(0.8) SMDegrain(thsad=818, tr=6, PreFilter=4) Deblock(quant=21, aOffset=13, bOffset=13) Descratch() AssumeFieldBased() Weave() TFM() TDecimate(Cycle=6, CycleR=1) Vinverse(sstr=2.7, amnt=255, uv=3, scl=0.25) Spline36Resize(720, 322) prefetch(24)
Also what settings did you use for the filters, as I would like to get it as identical as yours. Thanks -
I did not save my setting. (+ I usually don't use Avisynth, but Vapoursynth)
I used SSIQ with its default values, didn't use BM3D (I just know it might help, but is a pain to use).
CAS value seems too high for my liking, personally, I wouldn't use Prefilter with SMDegrain here.
DeScratch and DeSpot filters need to be adjusted, otherwise it will not help at all.
=> you should play around with those and read the documentation to understand what the parameters do.
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
Thanks Selur for the advice. I cant get DeSpot to show much difference in video, played around with parameters, so chose to use RemoveDirtMC instead. DeScratch was giving issues as sometimes it removes lines from video which it shouldn't. I read up on it as much as possible but no real luck.
Here is my new script:Code:a= LWlibavAudioSource("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v= Mpeg2Source("G:\future projects\Choi Lee Fut KF Files\Demux Files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) ColorMatrix(mode="rec.601->rec.709") Crop(14, 60, -12, -56, align=false) import("C:\Users\akuma\AviSynth+\plugins64+\RemoveDirtMC.avs") import("C:\Users\akuma\AviSynth+\plugins64+\Deblock_QED.avs") import("C:\Users\akuma\AviSynth+\plugins64+\Spotless.avs") SeparateFields() even = SelectEven().RemoveDirtMC(30) odd = SelectOdd().RemoveDirtMC(30) Interleave(even, odd) CAS(0.5) pre=fluxsmootht(3).removegrain(11) SMDegrain(tr=6,thSAD=500,contrasharp=30,prefilter=pre,str=1.2,refinemotion=true,lsb=true) AssumeFieldBased() Weave() Deblock_QED(quant1=24, quant2=26, aOff1=1, bOff1=2, aOff2=1, bOff2=2, uv=3) SpotLess(BlkSz=8, OLap=8/2, pel=2, Tm=false, Bblur=0.0, ThSAD=500, RadT=1) TFM() TDecimate(Cycle=5, CycleR=1) Vinverse(sstr=2.7, amnt=255, uv=3, scl=0.25) Spline36Resize(720, 322) prefetch(16)
[Attachment 88141 - Click to enlarge]
There is improvement in image with script:
Original:
[Attachment 88142 - Click to enlarge]
Avisynth Version:
[Attachment 88143 - Click to enlarge]
Also changed the TDecimate Cycle to 5 instead of 6 as it was giving some duplicate frames sometimes.
Any advice would be much appreciated.Last edited by Akuma786; 5th Aug 2025 at 10:14.
-
a. I would recommend applying deblocking and spotless on progressive content (so after vinverse or on the fields, whatever works better).
b. to me those lines look like something a typical case for descratch so tweaking the setting might help. Using 'mark' to see what would be filtered might help. (this only makes sense while DeScratch is the last filter used, so look at it while commenting out stuff behind it,..)
Maybe even use multiple Descratch calls with different settings, or use different setting on different scenes.users currently on my ignore list: deadrats, Stears555, marcorocchini -
Yeah, moving Deblocking and spotless on progressive content looks better.
Also moving RemoveDirtMC after SMDegrain, has fixed the distortion I was getting at some scene changes too.
Yeah I will try again, messing around with Descratch & if I can get it to remove scratches I will add to final script.
Thanks Selur. -
Script runs at 5fps on my computer when trying to ouput using virtual dub and only using 50% CPU. I'm wondering if maybe the script needs to be done in 2 parts or is it best to just run it like this. Maybe something in script ain't right!
Any knowlegable Avisynth user who can advice me on this please ? -
Yes, there is a definite order for these restoration steps. You can consult "VideoFred's" posts about 8mm film restoration over in doom9.org and use his scripts for film restoration. If you need incentive to learn about his AVISynth restoration scripts, click on this to see some of his "before/after" examples. They are absolutely brilliant.
Freddy Van de Putte
He deals with pristine film. My restoration is usually on badly-stored amateur film that is in terrible shape. Therefore my results don't look as good as his. Here is my "before/after" using my much faster version of his script (which is posted in his doom9.org threads).
John Meyer Before/After
Similar Threads
-
MPC-HC playing DVD's at 60FPS instead of 29.970FPS
By killerteengohan in forum Software PlayingReplies: 4Last Post: 13th Jan 2025, 00:05 -
De-Interlacing properly and changing 25FPS of DVD to 24FPS
By Akuma786 in forum RestorationReplies: 12Last Post: 19th Dec 2024, 09:26 -
De-Interlacing DVD and changing 25FPS To 24FPS
By Akuma786 in forum RestorationReplies: 0Last Post: 16th Dec 2024, 18:18 -
De-Interlacing properly and changing 29.97FPS of DVD to 24FPS
By Akuma786 in forum RestorationReplies: 70Last Post: 6th Oct 2023, 08:10 -
Dvd interlacing
By Johnnysh in forum DVD RippingReplies: 37Last Post: 6th Dec 2020, 14:34