VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    So here is my ideal avisynth script. A filter analyzes an entire file, it finds 2:3 pulldown interlaced content, 30p content, and 60i content. It processes each differently. IVTC, passthrough, and QTGMC. And everything is brought together into a 60p file. Is this kind of script possible? Perhaps using a Conditional Filter? I've tried multiple ideas I've found online cobbling together multiple scripts here and there, with no luck whatsoever. Any assistance would be GREATLY appreciated.
    Last edited by wright96d; 20th Feb 2021 at 18:11. Reason: Clarification
    Quote Quote  
  2. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    lol good luck. once the various 2:3, 30p, 60i, content sources have been combined and re-encoded into one video they will all now say they are most likely 30p if that was the selected output. you can't go back to the previous source without actually owning it.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  3. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by aedipuss View Post
    lol good luck. once the various 2:3, 30p, 60i, content sources have been combined and re-encoded into one video they will all now say they are most likely 30p if that was the selected output. you can't go back to the previous source without actually owning it.
    I'm not entirely sure what your last line is supposed to mean, but I think you're saying that source detection isn't possible. That's the entire purpose of this filter only accessible in MeGui.

    http://avisynth.nl/index.php/Interlace_detection
    Quote Quote  
  4. Originally Posted by wright96d View Post
    So here is my ideal avisynth script. A filter analyzes an entire file, it finds 2:3 pulldown interlaced content, 30p content, and 60i content. It processes each differently. IVTC, passthrough, and QTGMC. And everything is brought together into a 60p file.
    Why bother? The final result won't look much different than just running QTGMC alone on the final video. The 24p sections will have 3:2 repeats, the 30p sections will have 2:2 repeats. Unless you are planning on motion interpolating the 24p and 30p sections.
    Quote Quote  
  5. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by jagabo View Post
    Why bother? The final result won't look much different than just running QTGMC alone on the final video. The 24p sections will have 3:2 repeats, the 30p sections will have 2:2 repeats. Unless you are planning on motion interpolating the 24p and 30p sections.
    If that were actually true, I wouldn't be here.
    Quote Quote  
  6. Originally Posted by wright96d View Post

    If that were actually true, I wouldn't be here.
    It is actually true. What do you disagree with?
    Quote Quote  
  7. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by manono View Post
    What do you disagree with?
    I'm disagreeing with it being true. Because it is not. Being mostly the same, and being the same are two entirely different things. Yes, most of the time it will be indistinguishable. But when you go through multiple movies worth of mixed source extras, or videotape sitcoms with 24p intros, you find out that this is not always the case.
    Quote Quote  
  8. Then you want to keep all the quality of the 24p and 30p parts by - I assume - duplicating frames, and only bob the interlaced sections.

    He did say bobbing the entire thing with QTGMC wouldn't look 'much different', and he's right. I don't believe what you want is possible yet. I don't believe a filter has been developed to first run an analysis pass and then convert the entire thing to 59.94fps (IVTC what has to be IVTC'd followed by a ChangeFPS call to 60p, double the 30p to 60p, and bob with QTGMC the interlaced portions). You could do it manually, of course, but I guess you're looking for an automatic solution. Good luck.
    Quote Quote  
  9. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by manono View Post
    Then you want to keep all the quality of the 24p and 30p parts by - I assume - duplicating frames, and only bob the interlaced sections.

    He did say bobbing the entire thing with QTGMC wouldn't look 'much different', and he's right. I don't believe what you want is possible yet. I don't believe a filter has been developed to first run an analysis pass and then convert the entire thing to 59.94fps (IVTC what has to be IVTC'd followed by a ChangeFPS call to 60p, double the 30p to 60p, and bob with QTGMC the interlaced portions). You could do it manually, of course, but I guess you're looking for an automatic solution. Good luck.
    Even if that isn't possible, surely it's possible to use a conditional filter with "IsCombed" and the three passes described to achieve the same thing?
    Quote Quote  
  10. I haven't a clue. I'm with jagabo - just bob the whole thing and be done with it. Sorry, not much (any?) help.
    Quote Quote  
  11. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by manono View Post
    I haven't a clue. I'm with jagabo - just bob the whole thing and be done with it. Sorry, not much (any?) help.
    It's okay, I understand your confusion. I've been doing just that for years, but lately I discovered bobbing progressive sources can wreak havoc on sharp edges, so I've been trying to figure out a way to process them separately, without having to stitch everything together by hand. As you can imagine, I'm at a loss.
    Quote Quote  
  12. Try using interleaved TFMs with no post processing to bob, then use ConditionalFilter with IsCombedTIVTC to select:

    Code:
    function TFMBob(clip v, int "pp")
    {
        pp = default(pp, 6)
        v.GetParity() ? Interleave(TFM(v, field=1, pp=pp), TFM(v, field=0, pp=pp)) : Interleave(TFM(v, field=0, pp=pp), TFM(v, field=1, pp=pp))
    }
    
    LWlibavVideoSource("video.avi") 
    
    t = TFMBob(0)
    q = QTGMC()
    ConditionalFilter(t, q, t, "IsCombedTIVTC")
    Basically, any frame that still has combing after bobbing with TFM will be discarded and replaced with a frame from QTGMC.
    Quote Quote  
  13. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by jagabo View Post
    Try using interleaved TFMs with no post processing to bob, then use ConditionalFilter with IsCombedTIVTC to select:

    Code:
    function TFMBob(clip v, int "pp")
    {
        pp = default(pp, 6)
        v.GetParity() ? Interleave(TFM(v, field=1, pp=pp), TFM(v, field=0, pp=pp)) : Interleave(TFM(v, field=0, pp=pp), TFM(v, field=1, pp=pp))
    }
    
    LWlibavVideoSource("video.avi") 
    
    t = TFMBob(0)
    q = QTGMC()
    ConditionalFilter(t, q, t, "IsCombedTIVTC")
    Basically, any frame that still has combing after bobbing with TFM will be discarded and replaced with a frame from QTGMC.
    Thank you! Right now I'm getting occasional glitches. I'll continue testing tomorrow and let you know if I got the kinks worked out.
    Quote Quote  
  14. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by jagabo View Post
    Try using interleaved TFMs with no post processing to bob, then use ConditionalFilter with IsCombedTIVTC to select:
    I really appreciate your help, but unfortunately I don't think this is going to work. I'm getting too many missed frames where not much is moving. I've tried adjusting every setting in TFM I can find to adjust the combing detection parameters but nothing is working. Sure, I could just let it go, but if I was the type to do that, I wouldn't be here in the first place. I'm not really sure if this means combining everything by hand, or just letting QTGMC do it's thing. I guess I'll figure that out soon.

    Here is my current iteration of the script, in case you have anymore ideas.

    Code:
    Footage = AVISource("G:\Deinterlace\test.avi")
    
    function TFMBob(clip v, int "pp")
    {
    pp = default(pp, 6)
    slow = 2
    mode = 5
    cthresh = 0
    MI = 0
    blockx = 256
    blocky = 256
    metric = 1
    
        v.GetParity() ? Interleave(TFM(v, mode=mode, cthresh=cthresh, pp=pp, slow=slow, MI=MI, blockx=blockx, blocky=blocky, metric = metric, field=1), TFM(v, mode=mode, cthresh=cthresh, pp=pp, slow=slow, MI=MI, blockx=blockx, blocky=blocky, metric = metric, field=1)) : Interleave(TFM(v, mode=mode, cthresh=cthresh, pp=pp, slow=slow, MI=MI, blockx=blockx, blocky=blocky, metric = metric, field=0), TFM(v, mode=mode, cthresh=cthresh, pp=pp, slow=slow, MI=MI, blockx=blockx, blocky=blocky, metric = metric, field=0))
    }
    
    t = Footage.TFMBob(1)
    
    q = Footage.AssumeTFF.QTGMC(Preset="Slower", EdiThreads=4, NoiseProcess=0, Sharpness=0, SourceMatch=3, Lossless=2)
    
    ConditionalFilter(t, q, t, "IsCombedTIVTC", "=", "true")
    Quote Quote  
  15. Originally Posted by wright96d View Post
    I'm getting too many missed frames where not much is moving.
    Isn't that an argument for using smaller blocks rather than larger blocks?

    Maybe you need to adjust the settings in IsCombedTIVTC().

    Upload a sample of the video that's giving you problems.
    Last edited by jagabo; 23rd Feb 2021 at 07:38.
    Quote Quote  
  16. Member wright96d's Avatar
    Join Date
    Feb 2021
    Location
    Kentucky, USA
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by wright96d View Post
    I'm getting too many missed frames where not much is moving.
    Isn't that an argument for using smaller blocks rather than larger blocks?

    Maybe you need to adjust the settings in IsCombedTIVTC().

    Upload a sample of the video that's giving you problems.
    https://drive.google.com/file/d/1ManuJsMgvTQnQzcbLIYUXPTptdGml06P/

    I've had more luck using those settings in IsCombedTIVTC. Right now it's just a balancing act, so there aren't too many frames being detected as combed (the IVTC portions), and not enough.
    Quote Quote  
  17. There are a few mistakes in your script in post #14. You forgot to AssumeTFF() to the clip that's sent to TFMBob(). Within TFMBob() some of the four calls to TFM() have the wrong field value. You have the order 1, 1, 0, 0. They should be 1, 0, 0, 1, as in my original example. Those are causing the TFMBob() to bob the film sections with a 2:2:2:4 pattern rather than 2:3:2:3, making motion more jerky. I noticed that my original example called TFMBob(0) rather than TFMBob(1) -- which you fixed.

    As is common with introductory sequences, the clip does have some shots that were sped up or slowed down. For example, the "biking down Lombard Street" shot starting around 1:07. There are many orphaned fields. That is causing aliasing on some frames after processing. A straight QTGMC() of that shot looks better.
    Quote Quote  



Similar Threads

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