VideoHelp Forum




+ Reply to Thread
Results 1 to 24 of 24
  1. Hi, I have been trying to restore a cartoon (JEM) from DVD for the last few weeks. I'm still a beginner at Avisynth, so I'm looking for any advice and help to get the cleanest source. Here is my code:

    DGsource("VTS_03_1.dgi",fieldop=0)
    TFM()
    TDecimate()
    daa3()
    crop(4,0,-4,0)
    TemporalDegrain2(degrainTR=3)
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnright()
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnleft()
    nnedi3_rpow2(rfactor=2, cshift="Spline36Resize",fwidth=1440, fheight = 1080)
    ColorMatrix(mode="Rec.601->Rec.709")
    GradFun3()
    Prefetch(16)

    So I still have 3 main issues.

    I need a better way to correct the chroma; you can see pink at the edge of white parts and on the skin of the characters.

    There's another strange issue with the chroma where, on some frames, only the top part of the frame has a "ghost" of the previous frame that appears. I will put a picture as an example.

    My 3rd issue would be that on sudden scene changes, the last frame before the scene change has a lot of noise. I also still have some IVTC issues, but I'm not sure anything can be done besides manually replacing the problematic frames in an editing software.

    (The pictures were taken without any post processing just IVTC)

    Chroma issue example:
    Image
    [Attachment 90941 - Click to enlarge]

    Image
    [Attachment 90944 - Click to enlarge]

    Image
    [Attachment 90942 - Click to enlarge]

    Scene change noise (blocking of the picture?):
    Image
    [Attachment 90943 - Click to enlarge]

    Chroma bleed example:
    Image
    [Attachment 90940 - Click to enlarge]


    Thanks for any help (english is not my native language, sorry if theres some errors).
    Quote Quote  
  2. got a small unprocessed video sample?
    From an image I can't tell whether:
    Code:
    TFM()
    TDecimate()
    is the wrong approach or whether those chroma blends are already inside the separated fields.

    Code:
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnright()
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnleft()
    should help with light chroma bleeding, judging by the screenshots is not the issue here.

    => 'just' (T)IVTC with default setting might be your main issue.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Originally Posted by Selur View Post
    got a small unprocessed video sample?
    From an image I can't tell whether:
    Code:
    TFM()
    TDecimate()
    is the wrong approach or whether those chroma blends are already inside the separated fields.

    Code:
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnright()
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnleft()
    should help with light chroma bleeding, judging by the screenshots is not the issue here.

    => 'just' (T)IVTC with default setting might be your main issue.
    When i tried to demux the video from the DVD it always looked like it messed up the interlacing, i can give you the VOB of 1 episode from the DVD (the VOB of the episode in the picture) i uploaded it to my google drive : https://drive.google.com/file/d/1vb_3wf6ttMkNT9Z3RvCC_-dbC7NL8AP5/view?usp=sharing
    Quote Quote  
  4. Here is also an example of a frame that is still combed after the IVTC, it's frame number 9336 after decimating at 23.976 fps

    Image
    [Attachment 90945 - Click to enlarge]
    Quote Quote  
  5. Looking at the fields:
    a. the intro really didn't get enough bitrate:

    b. there are blends or artifacts already in some fields before some scene changes:



    (in the intro)
    c. rainbows are another issue:



    Ignoring the intro, bobbing the source and looking at the first 10k frames I noticed no chroma issues.
    So the chroma issues seem to be caused by wrong ivtc.
    The problem seems to be the field matching.
    Using TDecimate with clip2=QTGMC(FPSDivisor=2) seems fine. (Alternatively QTGMC followed by sRestore probably is fine too)
    Most of the other issues are due to compression artifacts.
    For the artifacts, I would start with MCTemporalDenoise with aggressive values.
    (Some machine learning based filters like scunet or dpir could also help; don't use SpotLess or DeSpot those will cause problems with such content)

    => don't use default TFM().TDecimate()

    For residual combing, add QTGMC(InputType=1) after TDecimate(...). Maybe also add SangNom().

    Cu Selur

    Ps.: If you want to do this properly you probably will have to use different filters on different scenes and sometimes replace frames,..
    Last edited by Selur; 24th Jan 2026 at 11:56. Reason: InputType=3 => InputType=1
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  6. Originally Posted by Selur View Post
    Looking at the fields:
    a. the intro really didn't get enough bitrate:

    b. there are blends or artifacts already in some fields before some scene changes:



    (in the intro)
    c. rainbows are another issue:



    Ignoring the intro, bobbing the source and looking at the first 10k frames I noticed no chroma issues.
    So the chroma issues seem to be caused by wrong ivtc.
    The problem seems to be the field matching.
    Using TDecimate with clip2=QTGMC(FPSDivisor=2) seems fine. (Alternatively QTGMC followed by sRestore probably is fine too)
    Most of the other issues are due to compression artifacts.
    For the artifacts, I would start with MCTemporalDenoise with aggressive values.
    (Some machine learning based filters like scunet or dpir could also help; don't use SpotLess or DeSpot those will cause problems with such content)

    => don't use default TFM().TDecimate()

    For residual combing, add QTGMC(InputType=1) after TDecimate(...). Maybe also add SangNom().

    Cu Selur

    Ps.: If you want to do this properly you probably will have to use different filters on different scenes and sometimes replace frames,..
    Thanks a lot for your help, i dont use QTGMC because it introduce blends and im trying to get the most clean progressive picture, here is an example when i add clip2=QTGMC(FPSDivisor=2) to Tdecimate

    Image
    [Attachment 90947 - Click to enlarge]


    Also i dont know if it's normal but i cant see your pictures it says "imgbb upload this content requires registration", and with QTGMC added to Tdecimate the chroma issue is also still there in some places :

    Image
    [Attachment 90948 - Click to enlarge]
    Quote Quote  
  7. And i ignore the intro because i only care about the episode itself, i will process the intro separately and redo everything in an editing software because the bumpers and some others little things are incorrect compared to the original broadcast it's also the wrong intro so i would put back the original intro later in editing.
    Quote Quote  
  8. What frame numbers are these?
    => nevermind, found another scene (11939)
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  9. i also have another issue, at decimation it's not always a good frame thats taken here is an example at this frame, that's why i thought about manually correcting those problems by processing a decimated version and an undecimated version (at 29.97fps) so i would take the problematic frames and replace them but maybe with the righ settings this issue can be fixed ?

    The good frame (frame 14934 at 29.97fps) :
    Image
    [Attachment 90952 - Click to enlarge]

    The frame taken by Tdecimate (frame 14935 at 29.97fps) :
    Image
    [Attachment 90953 - Click to enlarge]


    The frame number from my last message was 9308 (blue haired girl)
    Last edited by Lololobolosse; 24th Jan 2026 at 13:16.
    Quote Quote  
  10. Maybe, but I haven't found settings that fix this so far. (issues seem to be only around scene changes)
    AnimeIVTC might also be worth a try.

    Cu Selur
    Last edited by Selur; 24th Jan 2026 at 13:43.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  11. Originally Posted by Selur View Post
    Maybe, but I haven't found settings that fix this so far. (issues seem to be only around scene changes)
    AnimeIVTC might also be worth a try.

    Cu Selur
    I used AnimeIVTC first but i always had additional issues so the best way i found was with TFM, i will probably end up correcting all the chroma issues manually in editing because the next frame is usually the same so i will juste replace those frames with the previous and next ones, so this leaves me with two last problems, the bad selected frames at decimation and the colors, would you have recommendations to fix the colors issues on the edges ? with this code i used earlier it ends up doing a white halo in this scene (very visible around the skirt) for example and like you said earlier chroma bleed would not be the issue ?

    Code :
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnright()
    mergechroma(aWarpSharp2(depth=8, blur=3, type=1))
    turnleft()

    Image
    [Attachment 90955 - Click to enlarge]


    Heres is an example of the problem, we can clearly see on the jacket of the girl to the right, blue on the left edges and pink on the right edge, the issue is present everywhere we can clearly see it at the edge of the skin whre it's also pink etc

    Image
    [Attachment 90956 - Click to enlarge]
    Quote Quote  
  12. ChromaShiftSP(x=-1.5) or similar usually works

    But it might cause problems on other scenes.
    Alternatively mlrt with BleedOut:

    If Vapoursynth is also a possibility and you have an NVIDIA card, BasicVSR++ might also be interessting: https://imgsli.com/NDQ1MDY5

    For white halos, you could also try YAHR or DeHalo_alpha.
    Don't really see it in your example,... (the white there seems to be from the bushes)
    Also for white borders, aWarpSharp on chroma with a negative value might help too.

    Cu Selur
    Last edited by Selur; 24th Jan 2026 at 15:08.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  13. Originally Posted by Selur View Post
    ChromaShiftSP(x=-1.5) or similar usually works

    But it might cause problems on other scenes.
    Alternatively mlrt with BleedOut:

    If Vapoursynth is also a possibility and you have an NVIDIA card, BasicVSR++ might also be interessting: https://imgsli.com/NDQ1MDY5

    For white halos, you could also try YAHR or DeHalo_alpha.
    Don't really see it in your example,... (the white there seems to be from the bushes)
    Also for white borders, aWarpSharp on chroma with a negative value might help too.

    Cu Selur
    mlrt with bleedout seems to be doing a pretty good job but is it an avisynth filter ? i cant seem to be able to find any info about it, BasicVSR++ looks amazing but it transforms the image too much and we lose too much fine details and you can see the eyes completly changed colors and the white of the eye fused with the skin
    Quote Quote  
  14. https://github.com/Asd-g/avs-mlrt allows using models like https://openmodeldb.info/models/1x-BleedOut-Compact if you convert them to onnx. (can be done using chaiNNER)
    Yes, BasicVSR++ would usually be applied with a mask, i.e. only filter dark content to fix lines or another masks or with some contrast enhancer or similar before applying it.
    "the white of the eye fused with the skin " <- that probably is due to a dehalo filter and not BasicVSR++

    Cu Selur

    Ps.: Applied BasicVSR++ unmasked, and a bunch of other stuff, using Vapoursynth on the intro.

    PPs.: in case you use avs-mlrt you might also want to look at DPIR and SCUNet.
    Image Attached Files
    Last edited by Selur; 24th Jan 2026 at 16:55.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  15. Originally Posted by Selur View Post
    https://github.com/Asd-g/avs-mlrt allows using models like https://openmodeldb.info/models/1x-BleedOut-Compact if you convert them to onnx. (can be done using chaiNNER)
    Yes, BasicVSR++ would usually be applied with a mask, i.e. only filter dark content to fix lines or another masks or with some contrast enhancer or similar before applying it.
    "the white of the eye fused with the skin " <- that probably is due to a dehalo filter and not BasicVSR++

    Cu Selur

    Ps.: Applied BasicVSR++ unmasked, and a bunch of other stuff, using Vapoursynth on the intro.

    PPs.: in case you use avs-mlrt you might also want to look at DPIR and SCUNet.
    I made some tests and discovered that with this specific filter when you leave the blend option at false all the chroma issues seemed to dissappear, i read some forums and saw a thing called interlaced chroma recontruction because on some source with cuts and changing pattern theres a problem with the interlacing of the chroma apparently, could it be the case here ? I also tried avs-mlrt but the results were not that good so i will keep experimenting differently for the colors bleed

    code : IT(fps=24, threshold=20, pthreshold=75, ref="TOP", blend=false, debug=false)
    Quote Quote  
  16. Nice, if IT works for you, take that. ('noblend' parameter of TDecimate already is 'true' by default)
    Code:
    Telecide()
    Decimate()
    does seem to work without creating the chroma blends too.
    Last edited by Selur; 25th Jan 2026 at 02:35.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  17. Originally Posted by Lololobolosse View Post
    i also have another issue, at decimation it's not always a good frame thats taken here is an example at this frame, that's why i thought about manually correcting those problems by processing a decimated version and an undecimated version (at 29.97fps) so i would take the problematic frames and replace them but maybe with the righ settings this issue can be fixed ?

    The good frame (frame 14934 at 29.97fps) :
    Image
    [Attachment 90952 - Click to enlarge]

    The frame taken by Tdecimate (frame 14935 at 29.97fps) :
    Image
    [Attachment 90953 - Click to enlarge]


    The frame number from my last message was 9308 (blue haired girl)
    That's caused by TFM's post processor. It sees the very thin lines as residual combing and deinterlaces the frame. You can reduce that problem by raising the combing threshold, cthresh. Doing that can let some combed frames through though. But in this case a threshold is only slightly higher than the default will prevent the deinterlacing, 10 instead of the default of 9.
    Quote Quote  
  18. I tried a lot of things today and came up with this script to make a perfect progressive source for this episode, every freezeframe is where there was either chroma issues, blends or heavy noise on scene change, theres also a little function i wrote with an ai chatbot to allow me to manually fetch frames before decimation to fix some issues, i will apply all the denoising and upscaling in a separate script so i can have the untouched progressive source if i need it in the future.

    function ReplaceFrom(clip final, clip source, int frame_dest, int frame_source) {
    nouvelle_frame = source.Trim(frame_source, -1)
    nouvelle_frame = nouvelle_frame.AssumeFPS(final)
    partie_avant = (frame_dest == 0) ? GenerallyNullClip() : final.Trim(0, frame_dest-1)
    partie_apres = (frame_dest == final.FrameCount()-1) ? GenerallyNullClip() : final.Trim(frame_dest+1, 0)
    resultat = (frame_dest == 0) ? nouvelle_frame ++ partie_apres : \
    (frame_dest == final.FrameCount()-1) ? partie_avant ++ nouvelle_frame : \
    partie_avant ++ nouvelle_frame ++ partie_apres
    return resultat
    }
    DGsource("VTS_03_1.dgi", fieldop=0)
    AssumeTFF()
    clip_luma = Telecide(guide=1, post=1, vthresh=30)
    clip_chroma = Telecide(guide=1, post=2, vthresh=30)
    MergeChroma(clip_luma, clip_chroma)
    CleanSource = last
    TDecimate(mode=1)
    last = ReplaceFrom(last, CleanSource, 9326, 11657)
    last = ReplaceFrom(last, CleanSource, 9335, 11670)
    daa3()
    crop(4,0,-4,0)
    Spline36Resize(720,540)
    DGSharpen(strength = 1.0)
    FreezeFrame(6519, 6519, 6520)
    FreezeFrame(20254, 20254, 20255)
    FreezeFrame(6741, 6741, 6740)
    FreezeFrame(6854, 6854, 6853)
    FreezeFrame(7325, 7325, 7324)
    FreezeFrame(7326, 7326, 7324)
    FreezeFrame(11711, 11711, 11712)
    FreezeFrame(14318, 14318, 14317)
    FreezeFrame(143189, 14319, 14317)
    FreezeFrame(15621, 15621, 15620)
    FreezeFrame(16071, 16071, 16070)
    FreezeFrame(16079, 16079, 16078)
    FreezeFrame(16330, 16330, 16331)
    FreezeFrame(16295, 16295, 16294)
    FreezeFrame(16298, 16298, 16299)
    FreezeFrame(16392, 16392, 16393)
    FreezeFrame(16664, 16664, 16665)
    FreezeFrame(16661, 16661, 16662)
    FreezeFrame(17675, 17675, 17674)
    FreezeFrame(17676, 17676, 17674)
    FreezeFrame(18118, 18118, 18117)
    FreezeFrame(20920, 20920, 20919)
    FreezeFrame(21860, 21860, 21859)
    FreezeFrame(22253, 22253, 22251)
    FreezeFrame(22252, 22252, 22251)
    FreezeFrame(22748, 22748, 22746)
    FreezeFrame(22747, 22747, 22746)
    FreezeFrame(24784, 24784, 24785)
    FreezeFrame(24805, 24805, 24807)
    FreezeFrame(24806, 24806, 24807)
    FreezeFrame(24803, 24803, 24804)
    FreezeFrame(25008, 25008, 25007)
    FreezeFrame(25009, 25009, 25007)
    FreezeFrame(25214, 25214, 25215)
    FreezeFrame(25227, 25227, 25225)
    FreezeFrame(25226, 25226, 25225)
    FreezeFrame(25259, 25259, 25257)
    FreezeFrame(25258, 25258, 25257)
    FreezeFrame(26142, 26142, 26141)
    FreezeFrame(27288, 27288, 27289)
    FreezeFrame(27290, 27290, 27291)
    FreezeFrame(27296, 27296, 27297)
    FreezeFrame(27298, 27298, 27299)
    FreezeFrame(27300, 27300, 27301)
    FreezeFrame(28486, 28486, 28487)
    FreezeFrame(28636, 28636, 28635)
    FreezeFrame(32456, 32456, 32457)
    Quote Quote  
  19. Why use TDecimate and not Decimate?
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  20. For the residual chroma combing/blending, the first step is to detect it. Here I've used mt_edge to detect areas of combing (after TFM) in the chroma channels:

    Image
    [Attachment 90973 - Click to enlarge]


    On the left is the frame, the right is the areas of residual combing in white.

    The next step is to get good chroma from either the frame before or the frame after. In this case the next frame is the same as this one but free of the chroma combing/blending. But sometimes it's the frame before. And a few cases (scene changes) neither is a match.

    One could use a runtime filter to copy the good chroma to the bad frame (or just copy the entire frame) when the combing is detected. The trick is to determine which frame to get the good chroma from.
    Last edited by jagabo; 25th Jan 2026 at 13:14.
    Quote Quote  
  21. Originally Posted by Selur View Post
    Why use TDecimate and not Decimate?
    I did not notice i used Tdecimate instead of Decimate on the moment but i dont think it makes a difference
    Quote Quote  
  22. Originally Posted by jagabo View Post
    For the residual chroma combing/blending, the first step is to detect it. Here I've used mt_edge to detect areas of combing (after TFM) in the chroma channels:

    Image
    [Attachment 90973 - Click to enlarge]


    On the left is the frame, the right is the areas of residual combing in white.

    The next step is to get good chroma from either the frame before or the frame after. In this case the next frame is the same as this one but free of the chroma combing/blending. But sometimes it's the frame before. And a few cases (scene changes) neither is a match.

    One could use a runtime filter to copy the good chroma to the bad frame (or just copy the entire frame) when the combing is detected. The trick is to determine which frame to get the good chroma from.

    I had already tried a little to automate the process but when using telecide instead of TFM the number of those chroma issues is largely reduced so that's why i manually corrected them, the downside is i think that telecide leave blends is some frames i corrected, like frame number 27298 (line 65 of my code)
    Quote Quote  
  23. Now I'm working on the upscaling part and with my actual code I have this residual noise you can see it especially around the edges of the hair and the nose, etc. I'm trying to remove it while keeping the most details possible, by example, I can get it out with Hqdn3d but it erases a lot of fine details in the backgrounds etc, would anyone have a suggestion? And is my upscaling code good or could it be performed better ?

    Image
    [Attachment 91005 - Click to enlarge]


    code :

    FFmpegSource2("JEMP.mkv")
    TemporalDegrain2(degrainTR=3)
    nnedi3_rpow2(rfactor=2, cshift="Spline36Resize")
    ColorMatrix(mode="Rec.601->Rec.709")
    GradFun3()
    Quote Quote  
  24. Here is an unprocessed sample and a processed sample
    Image Attached Files
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!