VideoHelp Forum
+ Reply to Thread
Page 3 of 3
FirstFirst 1 2 3
Results 61 to 82 of 82
Thread
  1. TFM won't do that because the frame appears as two fields within the VOB file. It will always pair those fields. You can come close to reproducing the VLC frames with Yadif(mode=1).LanczosResize(2456,1826).

    What you can do is blur those blemishes away with something like:

    Code:
    MergeChroma(last, BinomialBlur(varC=1.0, U=3, V=3).aWarpSharp2(depth=10))
    After TDecimate(). That does cause some loss of color saturation of small objects though. Try varC=0.5 or other values to find good compromise.
    Last edited by jagabo; 1st Aug 2022 at 18:56.
    Quote Quote  
  2. Yeah that seems to fix those frames, but like you said there's a big loss of saturation for small objects. Looks like going below varC=0.5 causes issues, but that value still causes way too much saturation loss.
    Quote Quote  
  3. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Those artefacts originate from a badly done MPEG2 encoding. Thus a good deblocking is the vital first step (I feel like I said that before).

    If you don't want to use the standard DGDecode.dll that does support deblocking within MPEG2Source, Deblock_QED_i must be put right after MPEG2source.
    Quote Quote  
  4. deblock QED doesn't help this issue no matter where its put. And those artifacts don't appear in VLC like I'd shown before so its something happening in Avisynth.
    Quote Quote  
  5. Originally Posted by nikkmann View Post
    Yeah that seems to fix those frames, but like you said there's a big loss of saturation for small objects. Looks like going below varC=0.5 causes issues, but that value still causes way too much saturation loss.
    You could use it on just those very blocky sections.
    Quote Quote  
  6. Originally Posted by jagabo View Post
    Originally Posted by nikkmann View Post
    Yeah that seems to fix those frames, but like you said there's a big loss of saturation for small objects. Looks like going below varC=0.5 causes issues, but that value still causes way too much saturation loss.
    You could use it on just those very blocky sections.
    Oh? How do I do that? Is there some way to automate it? Cause that chroma telescining issue is pretty inconsistent. Sometimes it wont happen for like 10 frames, and then you'll randomly get 3 or 4 frames in a row that all have that issue.
    Quote Quote  
  7. If you use TFM(chroma=true) , that frame 28665 (in decimated frame numbers) will be deinterlaced

    You can use display=true to debug threshold values and other settings . You don't want to deinterlace and degrade good frames where a clean match is found. For example , decimated frame 4378 is detected as combed when using default settings, and deinterlaced instead of matched, leading to avoidable degredation. Raising cthresh to 11 lets it pass through undegraded (there are other settings you can adjust for detection, you might have to adjust blockx,blocky or MI) . And you have to check other sections to see if those settings are ok

    It's possible to use another deinterlacer with TFM's clip2 setting. eg. clip2=yadif(mode=0, order=1) , or clip2=qtgmc.selecteven, etc...
    Quote Quote  
  8. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Dang, you really resist taking advice, don't you?
    It's not happening in AviSynth. Sorry, that's BS! It's already in the source. You don't seem to believe that because of how it looks in VLC. VLC just deinterlaces with whatever method is selected, completely different approach. Maybe you should just recreate that in AviSynth if you like it.

    If you were to look at the unfiltered fields and frames of the MPEG2 source, you would see these same artefacts. It's not "chroma telecining". The MPEG2 artefacts make any IVTC filter have wrong decisions and show you the uglyness of the source. Thus the solution is to fight those compression artefacts and not ignore this fact. Anyways, I'm out of here.
    Quote Quote  
  9. I think everyone already knows the problem is in the source. The issue is how to alleviate it...

    I found that Santiag() of the chroma after TFM alleviates a lot of the chroma artifacts, with less blurring (loss of saturation) of small objects and corners (compared to BinomialBlur).

    Code:
    Mpeg2Source("VTS_01_1.d2v")
    TFM(d2v="VTS_01_1.d2v", slow=0, pp=0) 
    MergeChroma(last, last.Santiag(1,1).aWarpSharp2(depth=10).Subtitle("cblur", x=10, y=30))
    vinverse()
    TDecimate(Cycle=6,CycleR=1)
    #ColorMatrix(mode="rec.601->rec.709")
    deblock_qed(quant1=30,quant2=30)
    To limit the Santiag'd chroma to the only the worst frames I used poisondeathray's observation that adding chroma=true to TMF would deinterlace the test frame (#28665) and others that have a lot of those chroma artifacts. I compare TFM with and without chroma=true and only Santiag if there's a large difference:

    Code:
    # Absolute value of the difference between YUV channels.
    
    function AbsSubtractY(clip v1, clip v2)
    {
         mt_lutxy(v1, v2,"x y - abs", chroma="-128")
    }
    
    function AbsSubtractU(clip v1, clip v2)
    {
        AbsSubtractY(v1.UtoY(), v2.UtoY())
    }
    
    function AbsSubtractV(clip v1, clip v2)
    {
        AbsSubtractY(v1.VtoY(), v2.VtoY())
    }
    
    function AbsSubtractUV(clip v1, clip v2)
    {
        StackVertical(AbsSubtractU(v1, v2), AbsSubtractV(v1, v2))
    }
    
    ##########################################################################
    
    
    Mpeg2Source("VTS_01_1.d2v")
    
    l = TFM(d2v="VTS_01_1.d2v", chroma=false, slow=0, pp=0)
    c = TFM(d2v="VTS_01_1.d2v", chroma=true,  slow=0, pp=6)
    testclip = AbsSubtractUV(l, c)
    blurclip = MergeChroma(l, l.Santiag(1,1).aWarpSharp2(depth=10)).Subtitle("cblur", x=10, y=30)
    ConditionalFilter(testclip, blurclip, l, "YPlaneMax", "greaterthan", "50.0", show=false)
    
    vinverse()
    TDecimate(Cycle=6,CycleR=1)
    #ColorMatrix(mode="rec.601->rec.709")
    deblock_qed(quant1=30,quant2=30)
    Some frames that don't need it are changed but since the damage is minimal I think this is acceptable.

    Subtitle() is there just to make it easy to see which frames have the blurred chroma.

    Oh, I forgot to mention this screws up the opening shots with all the horizontal lines. You'll have to treat those differently.
    Last edited by jagabo; 2nd Aug 2022 at 22:28.
    Quote Quote  
  10. You must be a magician because this fixes all the issues I've mentioned and also processes faster. And when I upscale it with nnedi3 more detail seems to be retained. I didn't see any issues with the opening shots with the horizontal lines, at least compared to my original script. Any frames specifically?
    Quote Quote  
  11. If A/B swap between frames you can see horizontal stripes in the cblur frames are a little blurrier.

    Code:
    v1 = LWLibavVideoSource("old script.mkv", cache=false, prefer_hw=2).ShowFrameNumber(x=10, y=20)
    v2 = LWLibavVideoSource("new script.mkv", cache=false, prefer_hw=2).ShowFrameNumber(x=10, y=20)
    
    Interleave(v1, v2)
    Frames 1542 and 1543, for example (frame 771 before interleaving).
    Quote Quote  
  12. Ah I see, its hardly apparent though, I had to really stare to see the differences.
    One thing I did notice though, and probably the only "issue" I see at this point, is that vinverse() causes a fairly noticeable amount of blurring and detail loss.
    As an example, with it on, in frame 1540 the yellowish windowsills become alot blurrier, and at 5310 the decal on the spoiler of the car in the desert. These are just 2 examples but it seems to affect pretty much everything,
    These are frames which do not have any residual telescining artifacts (unlike frame 4634 with his figure in the window).
    Is there anyway to have vinverse() only activate on frames with visible telescining artifacts, or have it only apply on the new frames generated from merging the original telescined frames with TFM since those are the ones most likely to have the artifacts?

    EDIT: Also, for TFM I made slow=1 again, because I noticed with slow=0 some scenes were extremely aliased (frame 5232 for example). I'd rather have a random duplicate frame here and there than a very aliased image.
    Last edited by nikkmann; 4th Aug 2022 at 18:25.
    Quote Quote  
  13. To counteract the blurring by vinverse try adding a little vertical sharp after, Sharpen(0.0, 0.3).
    Quote Quote  
  14. That definitely helps with the overall image blurriness caused by vinverse() , but not with the loss of detail that could otherwise be avoided.
    So there's no way to have vinverse() selectively apply to telescine-artifacted footage? If not then thats ok, this is still miles better than what I originally had.
    Quote Quote  
  15. Another think you can try is using a motion mask. In theory, you only have comb artifacts where there is motion. So only blurring moving areas may help. Instead of just vinverse() try:

    Code:
    mmask = mt_motion(thy1=10, thy2=10).mt_expand().Blur(1.0)
    Overlay(last, vinverse, mask=mmask)
    You may need to adjust thy1 and thy2 (lower values will detect more motion, and vice versa).

    It might work better after decimation.
    Last edited by jagabo; 4th Aug 2022 at 20:10.
    Quote Quote  
  16. You could always use manual overrides or specify frame numbers . You probably have to anyways if you want better results - you'd need to filter frames differently since the noise and quality is quite variable. If you use 1 set of filters and/or 1 setting of VEIA - good frames will be degraded with more detail loss than there should be, or noisy frames will remain too noisy .
    Quote Quote  
  17. @jagabo Thats a great step in the right direction. The yellow windowsills on frame 1540 are no longer blurred, but stuff like the spoiler decal on 5310 still are (since the camera is moving).
    Tried messing with those thy values but going above 10 makes the telescine artifacts start to appear again, so don't really wanna change that.
    In addition to that mask, is there anyway to have it only apply to the new "merged" frames generated by TFM? Feel like thats as good as its possible to get it (if it is possible).
    Quote Quote  
  18. Originally Posted by nikkmann View Post
    stuff like the spoiler decal on 5310 still are (blurred).
    There's no way to tell what's combing vs. what's just lots of little horizontal line elements.

    Originally Posted by nikkmann View Post
    In addition to that mask, is there anyway to have it only apply to the new "merged" frames generated by TFM? Feel like thats as good as its possible to get it (if it is possible).
    One might be able to use IsCombedIVTC to limit the blurring to only those frames that TFM thinks were originally interlaced.
    Quote Quote  
  19. How do I use IsCombedIVTC? Didn't anything about it in the TFM documentation.
    Quote Quote  
  20. IsCombedTIVTC is a runtime filter. You use with one of the runtime functions like ConditionalFilter():

    Code:
    ConditionalFilter(testclip, yesclip, noclip, "IsCombedTIVTC()")
    testclip is the clip that's tested by IsCombedTIVTC()
    yesclip is the clip that's used if the testclip is combed
    noclip is the clip that's used if the testclip is not combed

    It's usage is decribed in the "ShowCombedTIVTC - READ ME.txt" that comes with the TIVTC package.
    Quote Quote  
  21. Tried messing with it a bit but couldn't figure it out, not sure what I'm supposed to do for the second source since its only 1 video. I'll just use the last bit of code you sent.
    Quote Quote  
  22. Originally Posted by nikkmann View Post
    Tried messing with it a bit but couldn't figure it out, not sure what I'm supposed to do for the second source since its only 1 video.
    You create the new clips from the existing clip. Look at the way Conditional filter is used earlier:

    Code:
    Mpeg2Source("VTS_01_1.d2v")
    l = TFM(d2v="VTS_01_1.d2v", chroma=false, slow=0, pp=0)
    c = TFM(d2v="VTS_01_1.d2v", chroma=true,  slow=0, pp=6)
    testclip = AbsSubtractUV(l, c)
    blurclip = MergeChroma(l, l.Santiag(1,1).aWarpSharp2(depth=10)).Subtitle("cblur", x=10, y=30)
    ConditionalFilter(testclip, blurclip, l, "YPlaneMax", "greaterthan", "50.0", show=false)
    Mpeg2Source() gets the original video. TFM(...) is used twice to create two new clips from the source, named l(uma) and c(hroma). testclip is another new clip created by AbsSubtract(...), it's basically the difference between l and c. blurclip is yet another clip created by MergeChroma(...). ConditionalFilter() then uses testclip to decide whether a frame should be taken from blurclip or l (frame by frame for the entire video).
    Quote Quote  



Similar Threads

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